Skip to content

Instantly share code, notes, and snippets.

@zeke
Created September 10, 2019 22:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeke/b7e7b63223f18135c2f0052977d4a1b6 to your computer and use it in GitHub Desktop.
Save zeke/b7e7b63223f18135c2f0052977d4a1b6 to your computer and use it in GitHub Desktop.
name: Standard
on:
pull_request:
paths:
- '*.js'
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: npm ci
run: npm ci
- name: lint and push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run lint
# exit if there are no changes to commit
[[ `git status --porcelain` ]] || exit
git checkout "${GITHUB_HEAD_REF}"
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git add .
git commit -am "lint!"
git push -u origin ${GITHUB_HEAD_REF}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment