Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify branch name #29

Closed
onilton opened this issue Apr 30, 2020 · 8 comments
Closed

Specify branch name #29

onilton opened this issue Apr 30, 2020 · 8 comments
Assignees
Labels
good first issue Good for newcomers type: feature New feature or feature request
Projects

Comments

@onilton
Copy link

onilton commented Apr 30, 2020

On scheduled workflow it is not possible to run add-and-commit against a specific branch since it relies on ${GITHUB_REF}.

schedule always use the last commit on default branch.

on:
  schedule:
    - cron: "50 10,17,20,23 * * *"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        ref: gh-pages # a custom branch

    - name: Commit changes
      uses: EndBug/add-and-commit@v4
      with:
        message: "Updated file"
        add: "file.csv"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I tried passing GITHUB_REF: refs/heads/gh-pages in env, but it didn't work

@EndBug EndBug added this to To do in Main board via automation Apr 30, 2020
@EndBug EndBug added type: bug Verified problems that need to be worked on good first issue Good for newcomers labels Apr 30, 2020
@EndBug
Copy link
Owner

EndBug commented Apr 30, 2020

Hi, thanks for the issue! Could you add a link to a workflow run that fails because of this? Just so that I can look at the logs...

@onilton
Copy link
Author

onilton commented Apr 30, 2020

Sure.

https://github.com/onilton/deck-covid19/blob/fc968c33dedd4ef46b35921f52e6b8e38ed1fadd/.github/workflows/main.yml

But the one described above in the issue description is reduced and will probably also cause the issue.

@RobinWijnant
Copy link
Contributor

I see you are trying to deploy to Github pages. Other actions are more suitable for this.
This is a popular one for example: https://github.com/marketplace/actions/github-pages-action

@EndBug
Copy link
Owner

EndBug commented May 1, 2020

Sure.

https://github.com/onilton/deck-covid19/blob/fc968c33dedd4ef46b35921f52e6b8e38ed1fadd/.github/workflows/main.yml

But the one described above in the issue description is reduced and will probably also cause the issue.

Ok, I see where the problem is: I'll add a ref option where you can put the branch name, just like in actions/checkout

@EndBug EndBug added type: feature New feature or feature request and removed type: bug Verified problems that need to be worked on labels May 1, 2020
@EndBug EndBug moved this from To do to In progress in Main board May 1, 2020
@EndBug EndBug self-assigned this May 1, 2020
@EndBug
Copy link
Owner

EndBug commented May 1, 2020

This should be fixed in version v4.1.0 (which you can also get via the v4 and latest tags)
You now have a ref option that you can use to select the branch you want to commit to.
Thanks for the issue!

@EndBug EndBug closed this as completed May 1, 2020
Main board automation moved this from In progress to Done May 1, 2020
@onilton
Copy link
Author

onilton commented May 1, 2020

Cool! Nice work. Thanks! 👏

@EndBug
Copy link
Owner

EndBug commented Jul 10, 2020

@all-contributors please add @onilton for ideas

@allcontributors
Copy link
Contributor

@EndBug

I've put up a pull request to add @onilton! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: feature New feature or feature request
Projects
No open projects
Main board
  
Done
Development

No branches or pull requests

3 participants