-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: fix secret passing in release workflows #189
Conversation
This pull request has been linked to Shortcut Story #233949: Swap sdk-test-harness to Github Actions. |
.github/workflows/manual-release.yml
Outdated
tag: ${{ inputs.tag }} | ||
secrets: | ||
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.
Because it is a workflow, instead of a composite, you shouldn't need to pass. The workflow can have its own permissions.
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.
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.
When a reusable workflow is triggered by a caller workflow, the github context is always associated with the caller workflow. The called workflow is automatically granted access to github.token and secrets.GITHUB_TOKEN. For more information about the github context, see "[Contexts](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context)."
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.
Workflows have a greater trust level than a composite, as they aren't really meant to come from external sources like a composite.
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.
Yea, I see that secrets
is automatically available. This does work though, but I'll refactor to remove it.
Didn't realize that reusable workflows need a special syntax for passing secrets like
GITHUB_TOKEN
, different thaninputs
.The existing config results in an invalid workflow file (although it works fine in
act
.)