Skip to content

Commit

Permalink
Yet another token info improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Jeliński <[email protected]>
  • Loading branch information
ajelinski committed Apr 29, 2021
1 parent e3bbfca commit e2cf5d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For example, after setting `NAME_OF_TOKEN_VAR` repository secret with *PAT*, use
with:
gh_access_token: ${{ secrets.NAME_OF_TOKEN_VAR }}
```
In case passing *PAT* is not an option, passing `secrets.GITHUB_TOKEN` can also create a Pull Request but it can't trigger PR Checks.
In case passing *PAT* is not an option, passing `secrets.GITHUB_TOKEN` will also result in creating a Pull Request, but without triggering PR Checks.

The inputs to this action are (bold ones are **required**):
* `branch_name_core`: Name of the pushed branch; it will be suffixed with GH Action's Run ID.
Expand Down
8 changes: 1 addition & 7 deletions update_conda_lock/create_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,10 @@ def create_pull_request(gh_repo, gh_token, pr_base, pr_head, pr_title, pr_body='

if __name__ == '__main__':
pr_time = datetime.utcnow().strftime('%Y-%m-%d %H:%M UTC')
pat_url='https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token'
secrets_url='https://docs.github.com/en/actions/reference/encrypted-secrets'
body = f"""
Pull Request created by the `{environ['GITHUB_WORKFLOW']}` workflow.
If this Pull Request should have triggered CI workflows but it hasn't,
make sure that the token passed with `gh_access_token` input to the
`update_conda_lock` action is a [Personal Access Token]({pat_url}). PR Checks
cannot be triggered using a common `secrets.GITHUB_TOKEN`. Still, do
pass it as an [encrypted secret]({secrets_url}) for security reasons.
If this Pull Request should have triggered CI workflows but it hasn't, make sure that the token passed with `gh_access_token` input to the `update_conda_lock` action is a [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). PR Checks cannot be triggered using a common `secrets.GITHUB_TOKEN`. Still, do pass *PAT* as an [encrypted secret](https://docs.github.com/en/actions/reference/encrypted-secrets) for security reasons.
"""
create_pull_request(
environ['GITHUB_REPOSITORY'],
Expand Down

0 comments on commit e2cf5d3

Please sign in to comment.