Open
Conversation
As per actions/runner#998 and https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-environment-name-and-url environment: blah exists for short form notations, and it doesn't support contexts. but environment: name: an expression is allowed here As per https://github.com/orgs/community/discussions/25238#discussioncomment-3247035, the secret names need to match between the environment at the caller and the reusable workflow: > I was finally able to get a solution/clarification from GitHub support. This is > what’s happening (and is the intended functionality of GitHub Actions). The > last line in the parent script, “TEST_SECRET: ${{ secrets.TEST_SECRET }}” is > granting access to the child script to read the value TEST_SECRET. It is not > actually passing the value because TEST_SECRET is not in scope at this point in > the code and is therefor an empty string. Since it’s being passed in however, > when the “environment: TestEnvironment” line is run in the child workflow, it > populates that secret with the environment’s value and can be used in the > associated steps. and rename GITHUB_APP_PRIVATE_KEY to VERSIONBUMP_GHAPP_PRIVATE_KEY because secrets can't start with "GITHUB" and better reflect what the app actually does. For Dockerfile builds in CI, add a new RO unsecure account and token that can be used on unprotected workflow runs Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
TODO: do this for all workflows without deduplicating this code The right way would be to create a script check_actor_permission.sh but this script is not checked out in the caller repo. There is no good workaround https://github.com/orgs/community/discussions/25289 https://github.com/orgs/community/discussions/25294 https://github.com/orgs/community/discussions/68735 https://github.com/orgs/community/discussions/63863 https://github.com/orgs/community/discussions/123261 The list goes on.. Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
This reverts commit fbe0b1d. Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
72a35bc to
4233414
Compare
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.
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
no
What kind of change does this PR introduce?
feature
What is the current behavior?
release = maintain
What is the new behavior (if this is a feature change)?
allow to specify in the caller workflow another permission than "maintain
Does this PR introduce a breaking change or deprecate an API?
Other information:
e.g. stronger "admin" for critical repos or weaker "push" for more lax repos.
The code is available here is we ever need it