Skip to content

Commit

Permalink
Fixes for PENDING_RUN and GITHUB_ORG
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed Aug 2, 2024
1 parent 633fb1f commit 19e9dfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
pipeline_settings: '{ "type": "tmt-multihost" }'
variables: "ANSIBLE_VER=${{ matrix.ansible_version }};\
REPO_NAME=${{ github.event.repository.name }};\
GITHUB_ORG=linux-system-roles;\
GITHUB_ORG=${{ github.repository_owner }};\
PR_NUM=${{ github.event.issue.number }};\
ARTIFACTS_DIR=${{ steps.set_vars.outputs.ARTIFACTS_DIR }};\
ARTIFACTS_URL=${{ steps.set_vars.outputs.ARTIFACTS_URL }};\
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tft_citest_bad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
PENDING_RUN=$(gh api "repos/$REPO/actions/workflows/tft.yml/runs?event=issue_comment" \
| jq -r '[.workflow_runs[] | select(.display_title="$PR_TITLE") | select(.status == "pending" or .status == "queued" or .status == "in_progress") | .id][0]')
if [ "$RUN_ID" = "null" ]; then # if pending run don't exist, take the last run with failure state
if [ "$PENDING_RUN" = "null" ]; then # if pending run don't exist, take the last run with failure state
RUN_ID=$(gh api "repos/$REPO/actions/workflows/tft.yml/runs?event=issue_comment" \
| jq -r '[.workflow_runs[] | select( .conclusion == "failure" ) | select ( .display_title="$PR_TITLE" ) | .id][0]')
echo "Re-running workflow $RUN_ID"
Expand Down

0 comments on commit 19e9dfd

Please sign in to comment.