2021-09-29 10:20:33 -07:00

41 lines
1.1 KiB
YAML

name: auto-format
on:
push:
branches: master
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- name: NPM install
# Don't run postinstall because we don't need to install sub-packages.
run: npm ci --ignore-scripts
- name: Format
run: npm run format
- name: Check if format produces git diff
id: ifChange
run: git diff --exit-code || echo "::set-output name=changed::yes"
- name: Create PR
if: steps.ifChange.outputs.changed == 'yes'
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.TEDIUM_BOT_GITHUB_ACCESS_TOKEN }}
commit-message: Auto-format
committer: Polymer GitHub Actions Robot <format-bot@polymer-project.org>
title: Auto-format master branch
body: This PR was auto generated by the auto-format GitHub action.
reviewers: azakus,e111077,asyncliz
branch: auto-format-action
branch-suffix: short-commit-hash
labels: "Ready for Google"