Skip to content

Commit 45e92ca

Browse files
rearrange workflow step to ensure validation only runs if PR was created
1 parent 0c462c4 commit 45e92ca

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

.github/workflows/import_meetup_events.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ jobs:
4242
cd tools
4343
python meetup_import.py
4444
45-
- name: Confirm only events.yml was modified
46-
run: |
47-
MODIFIED_FILES=$(git diff --name-only)
48-
echo "Modified files: $MODIFIED_FILES"
49-
if echo "$MODIFIED_FILES" | grep -qv "^_data/events.yml$"; then
50-
echo "ERROR: Unexpected files were modified"
51-
exit 1
52-
fi
53-
echo "Only events.yml was modified as expected"
54-
5545
- name: Create or Update Pull Request
5646
id: create-pr
5747
uses: peter-evans/create-pull-request@v7
@@ -64,11 +54,20 @@ jobs:
6454
body: |
6555
This PR was created automatically by a GitHub Action to import upcoming Meetup events.
6656
Only `_data/events.yml` should be updated.
67-
68-
Please review the changes `_data/events.yml` and ensure that everything is parsed correctly before merging.
6957
labels: |
7058
automation, auto-approve
7159
60+
- name: Confirm only events.yml was modified
61+
if: steps.create-pr.outputs.pull-request-number
62+
run: |
63+
MODIFIED_FILES=$(git diff --name-only)
64+
echo "Modified files: $MODIFIED_FILES"
65+
if echo "$MODIFIED_FILES" | grep -qv "^_data/events.yml$"; then
66+
echo "ERROR: Unexpected files were modified"
67+
exit 1
68+
fi
69+
echo "Only events.yml was modified as expected"
70+
7271
- name: Wait for required checks
7372
if: steps.create-pr.outputs.pull-request-number
7473
run: |

0 commit comments

Comments
 (0)