Skip to content

Commit 6068980

Browse files
committed
Output URL of the associated run and commit
1 parent f7294ef commit 6068980

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/quality-monitor-comment-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,26 @@ jobs:
3535
echo "Artifact details: ${{ steps.download-reference.outputs.artifacts }}"
3636
run_id=$(echo '${{ steps.download-reference.outputs.artifacts }}' | jq -r '.[0].workflow_run.id // "unknown"')
3737
run_number=$(echo '${{ steps.download-reference.outputs.artifacts }}' | jq -r '.[0].workflow_run.run_number // "unknown"')
38+
head_sha=$(echo '${{ steps.download-reference.outputs.artifacts }}' | jq -r '.[0].workflow_run.head_sha // "unknown"')
3839
echo "Downloaded artifact from Run ID: $run_id"
3940
echo "Downloaded artifact from Run Number: $run_number"
41+
echo "Downloaded artifact from Commit SHA: $head_sha"
42+
43+
if [ "$run_id" != "unknown" ]; then
44+
run_url="https://github.com/${{ github.repository }}/actions/runs/$run_id"
45+
echo "Run URL: $run_url"
46+
echo "run_url=$run_url" >> "$GITHUB_ENV"
47+
fi
48+
49+
if [ "$head_sha" != "unknown" ]; then
50+
commit_url="https://github.com/${{ github.repository }}/commit/$head_sha"
51+
echo "Commit URL: $commit_url"
52+
echo "commit_url=$commit_url" >> "$GITHUB_ENV"
53+
fi
54+
4055
echo "run_id=$run_id" >> "$GITHUB_ENV"
4156
echo "run_number=$run_number" >> "$GITHUB_ENV"
57+
echo "head_sha=$head_sha" >> "$GITHUB_ENV"
4258
- name: Fetch reports from dependency check and quality monitor workflows
4359
env:
4460
REPO: ${{ github.repository }}

0 commit comments

Comments
 (0)