-
Notifications
You must be signed in to change notification settings - Fork 0
ROX-32966: Add disabling label for the konflux retests #81
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
base: main
Are you sure you want to change the base?
Changes from all commits
18c1f78
14c6ca4
5e51585
c66a250
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ jobs: | |
| auto-retest-failed-konflux-build: | ||
| if: | | ||
| github.event_name == 'check_run' && | ||
| github.event.check_run.pull_requests[0] != null && | ||
| github.event.check_run.pull_requests.length > 0 && | ||
| github.event.check_run.conclusion == 'failure' && | ||
| startsWith(github.event.check_run.name, 'Red Hat Konflux') | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -82,6 +82,14 @@ jobs: | |
| RETEST_COMMAND: ${{ inputs.retest_command }} | ||
| run: | | ||
| CHECK_NAME="${{ github.event.check_run.name }}" | ||
| PR_NUMBER="${{ github.event.check_run.pull_requests[0].number }}" | ||
|
|
||
| # Fetch current PR labels to avoid race conditions with stale event data | ||
| CURRENT_LABELS=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER" --jq '.labels[].name') | ||
| if echo "$CURRENT_LABELS" | grep -q "^disable-konflux-auto-retest$"; then | ||
|
Comment on lines
+88
to
+89
Contributor
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.
$ gh pr view --json labels --jq '.labels[].name' https://github.com/stackrox/stackrox/pull/18943
CURRENT_LABELS="$(gh ...)"
if echo "$CURRENT_LABELS" | grep ...; thenyou can write if gh ... | grep ...; then |
||
| echo "Skipping retest: disable-konflux-auto-retest label is present" | ||
| exit 0 | ||
| fi | ||
|
Contributor
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. It seems like a new implementation that you landed 20 hours ago (according to GitHub). When I look at last comments/updates in https://github.com/stackrox/test-gh-actions/pull/240, they are from 2 days ago (according to GitHub). Would you like to test the change? |
||
|
|
||
| # Check if the check name ends with the configured suffix | ||
| if [[ ! "$CHECK_NAME" == *"$CHECK_NAME_SUFFIX" ]]; then | ||
|
|
||
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.
I remembered one more thing. I believe, default shell flags in GHA aren't exactly
set -euo pipefail. I suggest set them explicitly in each step here so the behavior meets what we usually expect from shell scripts.