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

force-push performed with github-actions bot's token #121

Closed
menny opened this issue Feb 17, 2020 · 4 comments
Closed

force-push performed with github-actions bot's token #121

menny opened this issue Feb 17, 2020 · 4 comments

Comments

@menny
Copy link

menny commented Feb 17, 2020

Force-push was done with a different token than provided

The workflow file that created the PR: https://github.com/AnySoftKeyboard/AnySoftKeyboard/blob/master/.github/workflows/localization_update.yml
I'm using a personal token for the user https://github.com/anysoftkeyboard-bot

The PR and commit were created with the right user. And PR checks ran.

Later, the workflow ran again and this time github-actions force-pushed.
Screen Shot 2020-02-16 at 10 12 21 PM

AnySoftKeyboard/AnySoftKeyboard#2057

@peter-evans
Copy link
Owner

@menny Thanks for reporting this issue. I think the reason for this is that v2 of checkout now preserves authentication for later use. If you don't provide a token it uses the default GITHUB_TOKEN. So it might be using that preserved token to push instead of the token set by the action. If this is case, I will investigate how to fix this so that the token passed to the action overrides the one set at checkout.

You can try adding your PAT to checkout as a workaround.

      - uses: actions/checkout@v2
        with:
          token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}

@menny
Copy link
Author

menny commented Feb 17, 2020

nice :)
will try and let you know.

menny added a commit to AnySoftKeyboard/AnySoftKeyboard that referenced this issue Feb 17, 2020
@peter-evans
Copy link
Owner

@menny I've now fixed this with the latest release so that you don't need to add your PAT to actions/checkout. The action should now correctly use the passed token to push.

@peter-evans
Copy link
Owner

@menny Going to close this issue now because I'm fairly confident that it's fixed. Please let me know if you see any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants