-
Notifications
You must be signed in to change notification settings - Fork 224
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
Use GITHUB_TOKEN instead of PAT in "Slash Command Dispatch" and "GMT Dev Tests" workflows #2950
Conversation
Done at https://github.com/seisman/pygmt/pull/1#issuecomment-1876078715. Seems to work seisman@4c0534c?
Opened at https://github.com/seisman/pygmt/pull/2. The format commands errors with:
|
In the GitHub Actions workflow, you could try setting the content permissions (https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs):
But I'm not sure if it'll really work. I've tried using |
I don't think it will work, because the default permissions are:
Anyway, at least we can remove PAT from |
Description of proposed changes
Based on the comments in peter-evans/slash-command-dispatch#147, it's possible to use
GITHUB_TOKEN
in slash command workflows. This PR removes the step for generating a PAT and usesGITHUB_TOKEN
instead, which can simplify our workflows.Since the slash commands can only run the workflows in the main branch, we can't test the changes without merging the PR.
I've committed the same changes to the main branch in my fork (https://github.com/seisman/pygmt) and tried the slash commands in PR https://github.com/seisman/pygmt/pull/1. Both
/test-gmt-dev
and/format
work (workflow run https://github.com/seisman/pygmt/actions/runs/7393878677 and commit 574e029).We still need to make sure that the slash commands work for new contributors without written permission and also work for PRs from forks. So, need your help here.
/test-gmt-dev
and/format
in PR https://github.com/seisman/pygmt/pull/1 to see if slash commands works for external contributors/test-gmt-dev
and/format
in your PRs.