Skip to content

use npx for gh action #4

use npx for gh action

use npx for gh action #4

name: Build and Update Changelog
on:
push:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: |
yarn install
yarn add github-changelog-generator
- name: Build
run: yarn build
- name: Generate Changelog
run: npx github-changelog-generator --output CHANGELOG.md --header-label '# Changelog' --unreleased --compare-link --future-release vNext
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add CHANGELOG.md
git commit -m "Update CHANGELOG.md" && git push origin || echo "No changes to commit"