Created
September 10, 2019 22:13
-
-
Save zeke/b7e7b63223f18135c2f0052977d4a1b6 to your computer and use it in GitHub Desktop.
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: 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