Skip to content

Conversation

@jonenst
Copy link
Collaborator

@jonenst jonenst commented Mar 19, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

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?

  • Yes
  • No

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

jonenst added 4 commits March 5, 2025 22:08
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 <[email protected]>
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 <[email protected]>
This reverts commit fbe0b1d.

Signed-off-by: HARPER Jon <[email protected]>
@jonenst jonenst force-pushed the configurable_permission branch from 72a35bc to 4233414 Compare March 19, 2025 13:19
Base automatically changed from enforce_permission to main March 20, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants