Skip to content

Commit

Permalink
Merge pull request #240 from VaniHaripriya/gh-test
Browse files Browse the repository at this point in the history
update test
  • Loading branch information
VaniHaripriya committed Sep 10, 2024
2 parents 6bbe08a + b069db5 commit 523f62f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/ci-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ jobs:
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
steps:
- name: Print Full Event Payload
id: print-event
run: |
echo "Full event payload:"
cat $GITHUB_EVENT_PATH
- name: Set PR_NUMBER
id: set-vars
Expand All @@ -40,15 +45,16 @@ jobs:
- name: Check Status of All Workflows
run: |
pr_number=${{ env.PR_NUMBER }}
echo "Checking statuses for PR #$pr_number"
echo "Checking statuses for PR #$pr_number"
echo "Repository: $GITHUB_REPOSITORY"
echo "Workflow: KFP Manifests"

# Print the latest workflow runs
gh run list --workflow "KFP Manifests" --json "id,head_sha,status,conclusion" | jq -r --arg pr_number "$pr_number" '.[] | select(.head_sha == $pr_number) | .status'
# Print the latest workflow runs for the PR
gh run list --workflow "KFP Manifests" --json number,headSha,status --repo $GITHUB_REPOSITORY | jq -r --arg pr_number "$pr_number" '.[] | select(.headSha == $pr_number) | .status'

# Check the status of the workflow for the given PR
statuses=$(gh run list --workflow "KFP Manifests" --json status | jq -r --arg pr_number "$pr_number" '.[] | select(.head_sha == $pr_number) | .status')
statuses=$(gh run list --workflow "KFP Manifests" --json status,headSha --repo $GITHUB_REPOSITORY | jq -r --arg pr_number "$pr_number" '.[] | select(.headSha == $pr_number) | .status')

# Print statuses
echo "Statuses: $statuses"
Expand All @@ -59,7 +65,7 @@ jobs:
exit 1
else
echo "All workflows succeeded. Adding 'ci-passed' label."
gh pr edit $pr_number --add-label "ci-passed"
gh pr edit $pr_number --add-label "ci-passed" --repo $GITHUB_REPOSITORY
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 523f62f

Please sign in to comment.