-
Notifications
You must be signed in to change notification settings - Fork 152
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
Remove unnecessary GH_TOKEN from publish job #4306
Conversation
The PAT token is enough to have the push rights.
Storybook staging is available at https://kiwicom-orbit-ci-remove-gh-token-from-publish.surge.sh |
Size Change: -5 B (0%) Total Size: 443 kB
ℹ️ View Unchanged
|
Deploying with Cloudflare Pages
|
@@ -58,7 +58,6 @@ jobs: | |||
if: ${{ github.event.inputs.dryrun == 'false' }} | |||
env: | |||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # must be of type Automation to create releases | |||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So secrets.PAT
is used for the Checkout step in this file, but for the Publish step, there won't be any GitHub token set.
Is that because we have the permissions.contents = write
at the beginning? In that case, is secrets.PAT
really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, GH_TOKEN
is a Lerna specific env variable, IIRC. So if we don't have it defined anymore, it's not going to work. Right?
https://github.com/lerna/lerna/tree/main/libs/commands/version#--create-release-type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PAT used for checkout persists through the whole job. It is the bot's PAT so it has the push rights needed on this step.
As for Lerna using GH_TOKEN, that is interesting. And I guess you are right, indeed. We didn't realize nor mention it in the discussion thread. So I guess there is nothing to do here 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PAT used for checkout persists through the whole job. It is the bot's PAT so it has the push rights needed on this step.
The CI job's PAT is actually available under secrets.GITHUB_TOKEN
, no? I don't think it's available under PAT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the commit and push must be authored by the bot. They can't rely on the CI job's PAT. So we basically need the bot's PAT for the commit and push and the GITHUB_TOKEN (provided by the job itself) to be used by Lerna. That is my understanding
As discussed IRL, nothing to do here. Closing. |
The PAT token is enough to have the push rights.
The branch protection rules for the master branch were also adjusted. We had @RobinCsl and @mvidalgarcia as exceptions but that is not needed since they're already admins.
FEPLT-1948