Skip to content
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

update test #240

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading