Merge pull request #225 from GreepTheSheep/depfu/update/npm/nodemon-3… #439
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
name: Lint | |
on: | |
push: | |
branches-ignore: | |
- 'main' | |
tags: | |
- '*' | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Declare commit sha variables | |
id: vars | |
shell: bash | |
run: echo "::set-output name=sha::$(echo ${GITHUB_SHA})" | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Node v16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
- name: Check if changes were made | |
id: check-changes | |
run: | | |
if [ -z "$(git diff --name-only HEAD)" ]; \ | |
then echo '::set-output name=changed::false'; \ | |
else echo '::set-output name=changed::true'; fi | |
- name: Commit files | |
if: steps.check-changes.outputs.changed == 'true' | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -am ":rotating_light: Lint - ${{ steps.vars.outputs.sha }}" | |
- name: Push changes | |
if: steps.check-changes.outputs.changed == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.gh_token }} | |
branch: ${{ github.ref }} |