-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
# in Github or Gitlab CI | ||
github_token() { | ||
# These will exist if the function is called in Gitlab. | ||
# If the function's called in Github, we should have GITHUB_ACCESS_TOKEN set |
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.
will this token then be used by the curl calls? otherwise setting it from another else block would help.
remove_label 'paritytech/substrate' "${CI_COMMIT_REF_NAME}" 'A7-needspolkadotpr' | ||
exit 0 | ||
else | ||
add_label 'paritytech/substrate' "${CI_COMMIT_REF_NAME}" 'A7-needspolkadotpr' |
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.
how about the error handling here if this is running from a pr? i used to use a helper job for this like here: https://gitlab.parity.io/parity/infrastructure/github-api/-/blob/master/.gitlab-ci.yml
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
Previously, we had a Github Action that would continuously monitor the status of the
check_polkadot_companion_build
job against a PR and label it depending on the outcome of that job. This PR just moves that logic into thecheck_polkadot_companion_build
itself. This'll hopefully do some work to reduce the amount of Github API calls we use, thus hopefully avoid issues such as this.While I was there, I also neatened up how we consume the GITHUB_TOKEN in
lib.sh
and fixed some shellcheck nags.Fixes paritytech/ci_cd#125
EDIT: Realised why this was a Github Action in the first place... Gitlab CI jobs running on PRs aren't protected branches (obviously), so don't have access to a Github token capable of updating labels on PRs. It's a bit shit and unless I come up with something to work around this, we're essentially stuck.