Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update title on opened prs #11

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}