Skip to content

Commit 6dbc486

Browse files
authored
Merge pull request #1589 from annietllnd/stats-pr-workflow
Change default workflow behavior to pass
2 parents 4094235 + 29e371d commit 6dbc486

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/stats-pr.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-24.04-arm
1313
steps:
1414
- name: Checkout main branch
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
with:
1717
ref: main
1818
- name: Download stats report as artifact
@@ -21,18 +21,30 @@ jobs:
2121
# Run ID of the workflow that uploaded the artifact
2222
run-id: ${{ github.event.workflow_run.id }}
2323
github-token: ${{ github.token }}
24+
- name: Check if artifact exists
25+
run: |
26+
if [ ! -d stats_current_test_info ]; then
27+
echo "No stats artifact found"
28+
echo "ARTIFACT_EXIST=false" >> "$GITHUB_ENV"
29+
else
30+
echo "Stats artifact found"
31+
echo "ARTIFACT_EXIST=true" >> "$GITHUB_ENV"
32+
fi
2433
- name: Move stats file
2534
# Unpack the artifact and move the stats file to the correct location
35+
if: env.ARTIFACT_EXIST == 'true'
2636
run: |
2737
mv stats_current_test_info/stats_current_test_info.yml data/stats_current_test_info.yml
2838
rm -rf stats_current_test_info
2939
- name: Set workflow link as environment variable
40+
if: env.ARTIFACT_EXIST == 'true'
3041
run: echo "WORKFLOW_URL=${{ github.event.workflow_run.workflow_url }}" >> $GITHUB_ENV
3142
- name: Echo Workflow URL
43+
if: env.ARTIFACT_EXIST == 'true'
3244
run: echo $WORKFLOW_URL
3345
- name: Create Pull Request
3446
uses: peter-evans/create-pull-request@v6
35-
if: success()
47+
if: env.ARTIFACT_EXIST == 'true' && success()
3648
with:
3749
commit-message: Update stats_current_test_info.yml
3850
title: Update stats_current_test_info.yml

0 commit comments

Comments
 (0)