File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,23 @@ jobs:
26
26
- name : Verify Meetups Data
27
27
run : bundle exec rake verify_meetups
28
28
29
- - name : Set up the formatted date and branch name
29
+ - name : Set up the formatted date, branch name and PR title
30
30
run : |
31
31
echo "FORMATTED_DATE=$(date +'%B %d, %Y')" >> $GITHUB_ENV
32
32
echo "BRANCH_TO_MERGE=new-meetups-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
33
33
echo "PULL_REQUEST_TITLE=$(cat ./pull_request_title.txt)" >> $GITHUB_ENV
34
34
35
+ - name : Check if there are any new meetups
36
+ run : |
37
+ if [[ -n $(git diff --name-only _data/meetups.yml) ]]; then
38
+ echo "NEW_MEETUPS=true" >> $GITHUB_ENV
39
+ else
40
+ echo "NEW_MEETUPS=false" >> $GITHUB_ENV
41
+ fi
42
+
35
43
- name : Commit New Meetups
36
44
uses : stefanzweifel/git-auto-commit-action@v5
45
+ if : ${{ env.NEW_MEETUPS == 'true' }}
37
46
with :
38
47
# Optional. Commit message for the created commit.
39
48
# Defaults to "Apply automatic changes"
97
106
create_branch : true
98
107
99
108
- name : Create Pull Request
109
+ if : ${{ env.NEW_MEETUPS == 'true' }}
100
110
run : gh pr create -B main -H ${{ env.BRANCH_TO_MERGE }} --title "${{ env.PULL_REQUEST_TITLE }}" --body-file "./new_meetups.md"
101
111
env :
102
112
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments