-
Notifications
You must be signed in to change notification settings - Fork 333
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
chore(IDX): use github.ref_protected where applicable #3936
base: master
Are you sure you want to change the base?
Conversation
This means we don't have to keep track of the protected branches and means we can use unified logic for protected ref detection.
protected_branches=("master" "rc--*" "hotfix-*" "master-private") | ||
|
||
# if we are on a protected branch or targeting a rc branch we set ic_version to the commit_sha and upload to s3 | ||
for pattern in "${protected_branches[@]}"; do | ||
if [[ "$BRANCH_NAME" == $pattern ]]; then | ||
IS_PROTECTED_BRANCH="true" | ||
break | ||
fi | ||
done | ||
|
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.
Unfortunately and confusingly setting IS_PROTECTED_BRANCH=${{ github.ref_protected }}
as an alternative to the above is not enough.
In ic-private the hotifx-*
branch is not protected. This means that if folks follow the "How to handle fixes for IC security vulnerabilities?" procedure, which specifies to push the hotfix to a hotfix-*
branch and then expects the artifacts to be uploaded (s3_upload="True"
), their artifacts won't be uploaded.
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.
@basvandijk arguably this is an issue in ic-private
where protected_branches
is then not aptly named, and/or an issue with the hotfix procedure. I'll see what I can do about that.
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.
Note that we shouldn't protect hotfix-*
in ic-private since that would prevent folks from creating hotfixes.
So I think it's indeed a naming issue. Maybe we should use a different wordt than "PROTECTED" above.
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.
Maybe:
protected_branches
->release_branches
IS_PROTECTED_BRANCH
->IS_RELEASE_BRANCH
@@ -73,3 +73,4 @@ runs: | |||
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }} | |||
SSH_PRIVATE_KEY_BACKUP_POD: ${{ inputs.SSH_PRIVATE_KEY_BACKUP_POD }} | |||
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }} | |||
IS_PROTECTED_BRANCH: ${{ github.ref_protected }} |
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.
This means we don't have to keep track of the protected branches and means we can use unified logic for protected ref detection.