Skip to content

Commit

Permalink
bug: fix changelog.yml to not commit and push on PR
Browse files Browse the repository at this point in the history
resolves #11
  • Loading branch information
jimbrig committed Mar 17, 2024
1 parent dd89f04 commit 5995e02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
changelog:
name: Generate changelog
name: Generate Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -26,13 +25,13 @@ jobs:
id: print-changelog
run: |
cat "CHANGELOG.md"
- name: Commit and Push
id: commit-push
# Commit and push the updated changelog, IF not a pull request
- name: Commit and Push Changelog
if: github.event_name != 'pull_request'
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit -m "[chore]: update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git "main"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git "main"
7 changes: 4 additions & 3 deletions workflow-templates/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ jobs:
id: print-changelog
run: |
cat "CHANGELOG.md"
- name: Commit and Push
id: commit-push
# Commit and push the updated changelog, IF not a pull request
- name: Commit and Push Changelog
if: github.event_name != 'pull_request'
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit -m "[chore]: update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git $default-branch
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git "main"

0 comments on commit 5995e02

Please sign in to comment.