Skip to content

Commit 02bc625

Browse files
committed
fix(ci): failed to find PR context
1 parent af21432 commit 02bc625

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,16 @@ jobs:
114114
fi
115115
116116
artifact_x86=linux-enable-ir-emitter-${version}-${buildtype}-x86-64.tar.gz
117-
echo "ARTIFACT_X86=$artifact_x86" >> "$GITHUB_ENV"
117+
echo "ARTIFACT_X86=$artifact_x86" >> "$GITHUB_OUTPUT"
118118
tar -czvf ${artifact_x86} -C target/${buildtype} linux-enable-ir-emitter
119119
120120
- name: Upload x86
121121
id: upload-x86
122122
if: ${{ steps.build.outcome == 'success' }}
123123
uses: actions/upload-artifact@v6
124124
with:
125-
name: ${{ env.ARTIFACT_X86 }}
126-
path: ${{ env.ARTIFACT_X86 }}
125+
name: ${{ steps.create-artifacts.outputs.ARTIFACT_X86 }}
126+
path: ${{ steps.create-artifacts.outputs.ARTIFACT_X86 }}
127127
if-no-files-found: error
128128

129129
- name: Save cached cargo dependencies

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ jobs:
1616
MESSAGE_FILE: ./message.md
1717
steps:
1818
- name: Check if in PR
19-
uses: insurgent-lab/is-in-pr-action@v0.2.0
20-
id: is-pr
19+
id: pr-number
20+
env:
21+
GH_TOKEN: ${{ github.token }}
22+
run: |
23+
pr_number=$(gh pr view --json number -q .number || echo '')
24+
echo "PR_NUMBER=$pr_number" >> $GITHUB_OUTPUT
2125
2226
- name: Create PR comment
2327
id: create-comment
24-
if: ${{ steps.is-pr.outputs.result == 'true' }}
28+
if: ${{ steps.pr-number.outputs.PR_NUMBER != '' }}
2529
run: |
2630
function outcome_emoji() {
2731
if [ "$1" == "success" ]; then
@@ -59,3 +63,4 @@ jobs:
5963
comment-tag: bot_comment
6064
mode: recreate
6165
file-path: ${{ env.MESSAGE_FILE }}
66+
pr-number: ${{ steps.pr-number.outputs.PR_NUMBER }}

0 commit comments

Comments
 (0)