You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.3 KiB

  1. name: ChangeLog
  2. on:
  3. workflow_dispatch:
  4. release:
  5. types: [published]
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/setup-node@v2-beta
  11. with:
  12. node-version: '12'
  13. - uses: actions/checkout@v2
  14. with:
  15. fetch-depth: 0
  16. - name: Checkout Tool
  17. uses: actions/checkout@v2
  18. with:
  19. repository: konakonall/auto-changelog
  20. path: 'auto-changelog'
  21. - name: Build Tool
  22. run: |
  23. cd auto-changelog
  24. npm install
  25. npm link
  26. - name: Generate ChangeLog
  27. env: # Or as an environment variable
  28. TOKEN: ${{ secrets.GITHUB_TOKEN }}
  29. run: |
  30. auto-changelog --token $TOKEN
  31. - name: Cat ChangeLog
  32. run: cat CHANGELOG.md
  33. - name: Commit files
  34. env:
  35. CI_USER: "gouki0123"
  36. CI_EMAIL: "gouki0123@gmail.com"
  37. run: |
  38. git config --local user.email "$CI_EMAIL"
  39. git config --local user.name "$CI_USER"
  40. git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo "push=1" >> $GITHUB_ENV || echo "No changes to CHANGELOG.md"
  41. - name: Push changes
  42. if: env.push == 1
  43. env:
  44. CI_USER: "gouki0123"
  45. CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  46. run: |
  47. git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master