Allow using GITHUB_TOKEN downstream#89
Merged
shahmishal merged 1 commit intoswiftlang:mainfrom Feb 14, 2025
Merged
Conversation
Contributor
Author
|
@shahmishal I've tested this on my fork of vscode-swift https://github.com/award999/vscode-swift/actions/runs/13144430476. It does allow us to download the artifact for the sake of testing the extension we may ship. https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token outlines the default permissions. |
Looking at https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context the `github.token` is only available withins the `steps`. Of the common workflow, but the jobs extending it do not have access. The vscode-swift extension publishes a build of the extension in a separate job, and we want to be able to download it within the common workflow so we can test what is actually might be released.
MahdiBM
reviewed
Feb 5, 2025
Comment on lines
+87
to
+90
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV |
There was a problem hiding this comment.
I wonder if something like this at call sites would do what you want:
uses: path/to/my/ci-file
+ secrets: inherit
Contributor
Author
There was a problem hiding this comment.
That didn't work unfortunately. secrets.GITHUB_TOKEN was empty
Contributor
Author
shahmishal
approved these changes
Feb 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Looking at https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context the
github.tokenis only available withins thesteps. Of the common workflow, but the jobs extending it do not have access. The vscode-swift extension publishes a build of the extension in a separate job, and we want to be able to download it within the common workflow so we can test what is actually might be released.