-
Notifications
You must be signed in to change notification settings - Fork 183
Add repository-dispatch workflow to deployment #497
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
Conversation
This PR adds a "repository dispatch" step to the build workflow. What this does is trigger a GitHub Actions run in the astropy/learn-astropy repository. The payload for the trigger includes a reference to the workflow artifact, which will allow the learn-astropy build to download the tutorials artifact. This requires a GitHub Secret to be set up on the tutorials repo named `DISPATCH_GITHUB_TOKEN` that has a write access to the astropy/learn-astropy repository. See https://github.com/peter-evans/repository-dispatch#token
This conservative versioning approach but prevents us from automatically updating to a new version of repository-dispatch. Dependabot will help us regularly re-evaluate the pin to get security and functionality updates from peter-evans/repository-dispatch.
@adrn Would you mind taking a look at this one? I don't think I can assign the review to you because of repo access. Keep in mind that you'll also need to set up the GitHub Personal Access Token and add it as a secret. The token could come from a user account or a custom GitHub App installed into astropy/learn-astropy. |
Whoops! I just added you to the Learn Astropy Maintainers team - that was an oversight on my part...
As in, when we merge this, right? |
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.
Cool, I think this looks good! So the DISPATCH_GITHUB_TOKEN should be a repo access token? With what privileges?
BTW: You might have permissions now to set up the token yourself? |
Awesome, I added the secret to the repo. Right now I'm using a Personal Access Token, but unfortunately, I can't scope it to a specific repository. I'll make a to-do for myself to investigate writing a new action that runs through a custom GitHub App because that apps essentially create tokens that are scoped to specific orgs/repos. For reference, the PAT has |
PAT is probably unavoidable. If necessary, another maintainer can refresh it in admin page. |
This PR adds a "repository dispatch" step to the build workflow. What this does is trigger a GitHub Actions run in the astropy/learn-astropy repository. The payload for the trigger includes a reference to the workflow artifact, which will allow the learn-astropy build to download the tutorials artifact.
This requires a GitHub Secret to be set up on the tutorials repo named
DISPATCH_GITHUB_TOKEN
that has write access to the astropy/learn-astropy repository. See https://github.com/peter-evans/repository-dispatch#token