Sending secrets with repository_dispatch
triggers to avoid GITHUB_TOKEN
limitations -- good idea or security risk?
#151839
Unanswered
grahamalama
asked this question in
Actions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
I've been thinking about ways to avoid the fact that you can't trigger other workflows from workflows that use
GITHUB_TOKEN
(docs).Some context -- the specific problem I'm looking to solve is automating pull requests to update values that represent version numbers for things that Dependabot doesn't know how to update. This could be used for any PR automation workflow, though.
I don't want to rely on PATs or upload an app's private key in each repository where I want to run a similar workflow. I had an idea for a way to avoid doing both of those things, but I'm wondering if it would be a bad idea from a security perspective:
Create an app, and install it in each repository where we want to run these custom update workflows
In some central repo, run a workflow on a
cron
schedule that sendsrepository_dispatch
events to configured repos to trigger these custom update workflows. Part of theclient_payload
would include the same installation token that'd be used to authorize the repository_dispatch call:repository_dispatch
as a trigger. For workflow steps that require a token, provide it as anenv
value:Providing this token has the minimal permissions necessary to complete this workflow and was scoped only to the repo where the workflow was running, there'd still be risk of the token leaking, but it seems that the damage would be minimal?
I'm wondering if I'm overlooking any risk, or if there's a better better way to go about achieving my goals entirely.
Beta Was this translation helpful? Give feedback.
All reactions