Skip to content

Commit 9263cfd

Browse files
Jami CogswellJami Cogswell
authored andcommitted
CI: save and upload comment id (if it exists)
1 parent d56a9f0 commit 9263cfd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/csv-coverage-pr-artifacts.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,25 @@ jobs:
8989
- name: Save PR number
9090
run: |
9191
mkdir -p pr
92-
echo ${{ github.event.pull_request.number }} > pr/NR
92+
echo ${PR_NUMBER} > pr/NR
93+
env:
94+
PR_NUMBER: ${{ github.event.pull_request.number }}
9395
- name: Upload PR number
9496
uses: actions/upload-artifact@v3
9597
with:
9698
name: pr
9799
path: pr/
100+
- name: Save comment ID (if it exists)
101+
run: |
102+
mkdir -p comment
103+
# Find the latest comment starting with COMMENT_PREFIX
104+
COMMENT_PREFIX=":warning: The head of this PR and the base branch were compared for differences in the framework coverage reports."
105+
gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" --paginate | jq --arg prefix "${COMMENT_PREFIX}" '[.[] | select(.body|startswith($prefix)) | .id] | max' > comment/ID
106+
env:
107+
GITHUB_TOKEN: ${{ github.token }}
108+
PR_NUMBER: ${{ github.event.pull_request.number }}
109+
- name: Upload comment ID (if it exists)
110+
uses: actions/upload-artifact@v3
111+
with:
112+
name: comment
113+
path: comment/

0 commit comments

Comments
 (0)