Skip to content
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

.github/workflows: pending-{set,clear} #96056

Merged
merged 1 commit into from Aug 25, 2020
Merged

.github/workflows: pending-{set,clear} #96056

merged 1 commit into from Aug 25, 2020

Conversation

zowoq
Copy link
Contributor

@zowoq zowoq commented Aug 23, 2020

Add actions to set a pending status that is then cleared by an ofborg event.

Initial dicussion in NixOS/ofborg#527

Tested in a personal repo with travis.

cc @Mic92

name: "set pending status"

on:
pull_request_target:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target

This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run.

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me if it works!

@zowoq
Copy link
Contributor Author

zowoq commented Aug 23, 2020

Guess we need a token, it would need to have repo:status and public_repo scopes. The tokens username/avi is shown as having set the status so we'll want one from a bot and not a real user.

cc @domenkozar @zimbatm

@GrahamcOfBorg would probably be the easiest to use but not sure that anyone else has the keys to it? @cole-h Do you know?

@Mic92
Copy link
Member

Mic92 commented Aug 24, 2020

What scope does a token has when it builds on the master branch?

@zowoq
Copy link
Contributor Author

zowoq commented Aug 24, 2020

Seems that the default GITHUB_TOKEN is sufficient for this, sorry for the noise.

@zowoq zowoq marked this pull request as ready for review August 25, 2020 00:38
@zowoq zowoq merged commit b2b1d3d into NixOS:master Aug 25, 2020
@zowoq zowoq deleted the pending branch August 25, 2020 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants