Skip to content

Commit

Permalink
ci: Update title on opened prs (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton authored Jul 8, 2024
1 parent 3a519e2 commit f7d11b1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,29 @@ jobs:
if: ${{ steps.fetch_icons.outputs.files_changed == 'true'}}
id: date
run: echo date=$(date +'%d-%b-%Y') >> $GITHUB_OUTPUT
- name: Create PR title
id: title
run: |
if [ ${{github.ref_name=='main'}} ]; then
TITLE='feat: Icon updates ${{ steps.date.outputs.date }}'
else
TITLE='feat: Icon updates ${{ steps.date.outputs.date }}(${{github.ref_name}})'
fi
echo "TITLE=$TITLE" >> $GITHUB_OUTPUT
- name: Push
if: ${{ steps.fetch_icons.outputs.files_changed == 'true'}}
run: |
git checkout -b ${{steps.branch_name.outputs.BRANCH_NAME}}
git config --global user.name "zeta-icons-bot"
git config --global user.email "[email protected]"
git add -A
git commit -m "feat: Icon updates ${{ steps.date.outputs.date }}"
git commit -m "${{steps.title.outputs.TITLE}}"
git push --set-upstream origin ${{steps.branch_name.outputs.BRANCH_NAME}} -f
- name: Check if PR exists
run: echo "pr_exists=$(gh pr list -H ${{steps.branch_name.outputs.BRANCH_NAME}} --json number -q length)" >> $GITHUB_ENV
- name: Create Pull Request
if: ${{env.pr_exists == 0 && steps.fetch_icons.outputs.files_changed == 'true'}}
run: gh pr create -B main -H ${{steps.branch_name.outputs.BRANCH_NAME}} --title "feat:${{steps.branch_name.outputs.BRANCH_NAME}}" --body 'Created by the Zeta Icons bot'
run: |
gh pr create -B main -H ${{steps.branch_name.outputs.BRANCH_NAME}} --title "${{steps.title.outputs.TITLE}}" --body 'Created by the Zeta Icons bot'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f7d11b1

Please sign in to comment.