-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(run changelog on main push): run changelog on main push
- Loading branch information
1 parent
dd752ab
commit 97deade
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Node CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Check if user has write access' | ||
uses: 'lannonbr/repo-permission-check-action@2.0.0' | ||
with: | ||
permission: 'write' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@master | ||
ref: main | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
version: 12.x | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: | | ||
node_modules | ||
*/*/node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install project dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here! | ||
run: yarn | ||
- name: test | ||
run: yarn test | ||
- name: generate changelog | ||
run: yarn generate:changelog | ||
- name: Commit changelog | ||
continue-on-error: true | ||
run: | | ||
git add . | ||
git -c user.name="imbhargav5" -c user.email="imbhargav5@users.noreply.github.com" \ | ||
commit -m "Update changelog [skip ci]" --no-verify --quiet | ||
git push "https://imbhargav5:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" main |