-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dbp-1067-optional-rollout-prevention #92
Open
maxi418
wants to merge
30
commits into
main
Choose a base branch
from
DBP-1067-optional-rollout-prevention
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5668fe2
Test getting PR labels
maxi418 8cde59c
Merge remote-tracking branch 'origin/main' into DBP-1067-optional-rol…
maxi418 aba039d
remove pr event condition
maxi418 9467509
test env var
maxi418 a9325ad
rename env var
maxi418 85b524f
add github authentication
maxi418 b5e94b5
use github_token
maxi418 33b179a
prevent failing without existing PR
maxi418 28778bc
edit env var
maxi418 b4e6673
has pr condition
maxi418 e1856e5
remove dot
maxi418 28186f8
test clearance
maxi418 b4f6aec
correct var name
maxi418 365feb9
test push
maxi418 14b1258
debug output
maxi418 c5e8ffe
test output
maxi418 7bbf8b9
test output
maxi418 8345ffa
new name
maxi418 b2ccc22
test output
maxi418 bee5db3
correct variable for output
maxi418 8e68c07
remove debugging steps
maxi418 e9ef6db
correct condition
maxi418 8277762
test new condition
maxi418 7f3fc3e
test
maxi418 b5e9abf
test
maxi418 994baf2
new condition
maxi418 17dea2a
remove quotation marks
maxi418 03db956
test condition
maxi418 8246a46
test output
maxi418 c3b27e6
new condition
maxi418 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,47 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
check_merge_clearance: | ||
name: "Check merge clearance" | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
outputs: | ||
merge_clearance: ${{ steps.determine_merge_clearance.outputs.merge_clearance }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get PR number | ||
id: get_pr_number | ||
run: | | ||
PR_NUMBER=$(gh pr list --state open --head ${{ github.ref_name }} --json number --jq '.[0].number') | ||
if [ -z "$PR_NUMBER" ]; then | ||
echo "No existing PR found for ${{ github.ref_name }} " | ||
else | ||
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV | ||
fi | ||
|
||
- name: Get PR labels | ||
id: get_pr_labels | ||
if: ${{ env.PR_NUMBER != '' }} | ||
run: | | ||
PR_LABELS=$(gh pr view ${{ env.PR_NUMBER }} --json labels --jq '.labels | map(.name) | join(",")') | ||
echo "PR_LABELS=$PR_LABELS" >> $GITHUB_ENV | ||
|
||
- name: Determine merge clearance | ||
id: determine_merge_clearance | ||
run: | | ||
if [ -z "$env.PR_NUMBER" ] || [[ ${{ ! contains(env.PR_LABELS, 'prevent_auto_deployment') }} == true ]]; then | ||
echo "merge_clearance=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "merge_clearance=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
|
||
- name: test output | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be removed |
||
run: | | ||
echo "test output: " ${{ steps.determine_merge_clearance.outputs.merge_clearance }} | ||
|
||
codeql_analyze: | ||
name: "CodeQL" | ||
if: ${{ github.event_name == 'push' }} | ||
|
@@ -26,8 +67,10 @@ jobs: | |
security-events: write | ||
|
||
build_image_on_push: | ||
needs: | ||
- check_merge_clearance | ||
name: "Publish image and scan with trivy" | ||
if: ${{ github.event_name == 'push' }} | ||
if: ${{ github.event_name == 'push' && needs.check_merge_clearance.outputs.merge_clearance == 'true' }} | ||
permissions: | ||
packages: write | ||
security-events: write | ||
|
@@ -50,7 +93,9 @@ jobs: | |
contents: read | ||
|
||
select_helm_version_generation_and_image_tag_generation: | ||
if: ${{ github.event_name == 'push'}} | ||
needs: | ||
- check_merge_clearance | ||
if: ${{ github.event_name == 'push' && needs.check_merge_clearance.outputs.merge_clearance == 'true' }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
SELECT_HELM_VERION_GENERATION: ${{ steps.select_generation.outputs.SELECT_HELM_VERION_GENERATION }} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
in the other prs determine_deployment_clearance is used, not merge