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

ci(release): Add killswitch via issues w/ release-blocker label #714

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

BYK
Copy link
Member

@BYK BYK commented Aug 15, 2020

Implements https://app.asana.com/0/1169344595888357/1146357826982899/f which would cancel the workflow (stop the release) when the repo has open issues with the label 'release-blocker'.

Implements app.asana.com/0/1169344595888357/1146357826982899/f which would cancel the workflow (stop the release) when the repo has open issues with the label 'release-blocker'.
@BYK BYK requested a review from a team August 15, 2020 18:38
- id: killswitch
if: ${{ !github.event.inputs.force }}
run: |
if curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY/issues?state=open&labels=release-blocker" | grep -Pzvo '\[[\s\n\r]*\]'; then
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it makes sense to add the GitHub token to this request too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Why do you think so? The token would only help with 2 issues (as far as I can tell):

  1. If this repo was private
  2. If there was any rate limiting concerns

I see none apply here. Do you have something else in mind that I am missing?

Copy link
Member

Choose a reason for hiding this comment

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

Rate limiting, mostly. I remember Travis had a rate-limiting issue at some point when talking to GitHub, and since we already have the token in the environment, we could just use it to be on the safe side.
I know it's GitHub Actions, but they still must have a limited number of IPs in their disposal.

Copy link
Member

Choose a reason for hiding this comment

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

from experience, in travis you pretty much hit the unauthenticated rate limits instantly when doing api requests on every master push, but this only runs per release. it should be fine but adding the token seems like a low-hanging fruit still:

        --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \

https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll pass for now until this becomes a real issue to keep things simpler. Thanks a lot for pointing this out though.

.github/workflows/release.yml Show resolved Hide resolved
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

LGTM and makes a lot of sense, thanks!

@BYK BYK merged commit c91a5c2 into master Aug 17, 2020
@BYK BYK deleted the byk/ci/killswitch-for-release branch August 17, 2020 13:31
jan-auer added a commit that referenced this pull request Aug 18, 2020
* master:
  fix: Coerce missing PR body to empty string
  meta(gh): Add a status check for changelogs (#700)
  ref(server): Manually control concurrent upstream requests (#678)
  fix(docs): Clarify sooner which mode to choose (#709)
  chore(config): Remove config for emitting attachment flags (#718)
  fix(protocol): Fix docs typo (#719)
  fix(doc): Add missing newlines (#717)
  ci(release): Add killswitch via issues w/ release-blocker label (#714)
  fix: Add changelog entry for #712 (#716)
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.

None yet

4 participants