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

Pushes performed by [email protected] despite scoped token #87

Closed
pauleve opened this issue Dec 13, 2019 · 3 comments
Closed

Pushes performed by [email protected] despite scoped token #87

pauleve opened this issue Dec 13, 2019 · 3 comments

Comments

@pauleve
Copy link

pauleve commented Dec 13, 2019

Related to issue #48, I specified a personal access token as GITHUB_TOKEN environment for the action. However, the pushes are still marked as being done by [email protected]..
Then, I cannot find a way to trigger other actions when an update is done to the PR this action, neither pull_request/synchronize, nor push/branches seem to work..
Any idea how to make working the push using the personal access token?

Here is the excerpt of configuration I use:

    - name: Create Pull Request
      uses: peter-evans/create-pull-request@v1
      env:
          GITHUB_TOKEN: ${{ secrets.PAT }}
      with:
        commit-message: "[auto] update tools"
        title: Automated update of tools
        body: This is an auto-generated PR with tool updates.
        labels: pkg-update, autodocker
        assignees: pauleve
        branch: auto/tool-updates
        branch-suffix: none

(the full action is here: https://github.com/colomoto/colomoto-docker/blob/master/.github/workflows/auto-update.yml)

Here is an example of PR which has been updated, but with pushes authored by [email protected]:
colomoto/colomoto-docker#41

@peter-evans
Copy link
Owner

peter-evans commented Dec 15, 2019

I think this behaviour is due to the recent v2 release of actions/checkout. I notice you are following the master branch of checkout with actions/checkout@master, so you are now using v2.

I haven't completely figured out how these changes affect this action yet. Not sure if this will solve your issue, but what you could try is setting the PAT on the checkout, too.

    - uses: actions/checkout@v2
      with:
        token: ${{ secrets.PAT }}
        ref: master

@pauleve
Copy link
Author

pauleve commented Dec 15, 2019

That has solved the issue, thank you very much!

@pauleve pauleve closed this as completed Dec 15, 2019
@peter-evans
Copy link
Owner

@pauleve Just to let you know that recent versions of the action have fixed this problem and it shouldn't be necessary to checkout using the PAT. The action will now correctly use the PAT passed to it to push.

    - uses: actions/checkout@v2

    # Make changes to pull request here

    - name: Create Pull Request
      uses: peter-evans/create-pull-request@v2
      with:
        token: ${{ secrets.PAT }}

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