File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,23 @@ jobs:
2626 - name : Verify Meetups Data
2727 run : bundle exec rake verify_meetups
2828
29- - name : Set up the formatted date and branch name
29+ - name : Set up the formatted date, branch name and PR title
3030 run : |
3131 echo "FORMATTED_DATE=$(date +'%B %d, %Y')" >> $GITHUB_ENV
3232 echo "BRANCH_TO_MERGE=new-meetups-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
3333 echo "PULL_REQUEST_TITLE=$(cat ./pull_request_title.txt)" >> $GITHUB_ENV
3434
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+
3543 - name : Commit New Meetups
3644 uses : stefanzweifel/git-auto-commit-action@v5
45+ if : ${{ env.NEW_MEETUPS == 'true' }}
3746 with :
3847 # Optional. Commit message for the created commit.
3948 # Defaults to "Apply automatic changes"
97106 create_branch : true
98107
99108 - name : Create Pull Request
109+ if : ${{ env.NEW_MEETUPS == 'true' }}
100110 run : gh pr create -B main -H ${{ env.BRANCH_TO_MERGE }} --title "${{ env.PULL_REQUEST_TITLE }}" --body-file "./new_meetups.md"
101111 env :
102112 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments