Skip to content

Commit 6fae2a1

Browse files
committed
fix: handle missing pr-number artifact gracefully
- Add if_no_artifact_found: warn to prevent job failure - Add continue-on-error to artifact download step - Check for pr-number.txt existence before reading - Skip bot execution if no PR number found - Only run if workflow_run conclusion is success
1 parent 98aeacb commit 6fae2a1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/auto-review-bot.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,31 @@ jobs:
1010
auto-review-bot:
1111
runs-on: ubuntu-latest
1212
name: Run
13+
if: github.event.workflow_run.conclusion == 'success'
1314
steps:
1415
- name: Fetch PR Number
1516
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
17+
continue-on-error: true
1618
with:
1719
name: pr-number
1820
workflow: auto-review-trigger.yml
1921
run_id: ${{ github.event.workflow_run.id }}
22+
if_no_artifact_found: warn
2023

2124
- name: Save PR Number
2225
id: save-pr-number
23-
run: echo "pr=$(cat pr-number.txt)" >> $GITHUB_OUTPUT
26+
run: |
27+
if [ -f pr-number.txt ]; then
28+
echo "pr=$(cat pr-number.txt)" >> $GITHUB_OUTPUT
29+
else
30+
echo "pr=" >> $GITHUB_OUTPUT
31+
fi
2432
2533
- name: Auto Review Bot
2634
id: auto-review-bot
2735
uses: ethereum/eip-review-bot@dist
2836
continue-on-error: true
37+
if: steps.save-pr-number.outputs.pr != ''
2938
with:
3039
token: ${{ secrets.TOKEN }}
3140
config: config/eip-editors.yml

0 commit comments

Comments
 (0)