Skip to content

Commit

Permalink
add auto changelog workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
konakonall committed Nov 26, 2020
1 parent 6bc7b52 commit ca3ea38
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/auto-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: ChangeLog

on:
workflow_dispatch:
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Checkout Tool
uses: actions/checkout@v2
with:
repository: konakonall/auto-changelog
path: 'auto-changelog'
- name: Build Tool
run: |
cd auto-changelog
npm install
npm link
- name: Generate ChangeLog
env: # Or as an environment variable
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
auto-changelog --token $TOKEN
- name: Cat ChangeLog
run: cat CHANGELOG.md

- name: Commit files
env:
CI_USER: "gouki0123"
CI_EMAIL: "gouki0123@gmail.com"
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo "push=1" >> $GITHUB_ENV || echo "No changes to CHANGELOG.md"
- name: Push changes
if: env.push == 1
env:
CI_USER: "gouki0123"
CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master

0 comments on commit ca3ea38

Please sign in to comment.