GITBOOK-193: change request with no subject merged in GitBook #51
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: Auto-fix Lint | |
on: | |
push: | |
branches: | |
- v6 | |
- v7 | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# Safeguard against creating a loop | |
if: "${{ github.event.commits[0].message != 'chore: auto-fix lint' }}" | |
steps: | |
- name: Generate GitHub App token | |
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 | |
id: generate-token | |
with: | |
creds: ${{ secrets.GH_APP_CREDS }} | |
export-git-user: true | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag: v4.1.1 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Setup Node.js | |
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # tag: v4.0.0 | |
with: | |
node-version: lts/* | |
- name: Create a Temporary package.json | |
run: npm init --yes | |
- name: Install @electron/lint-roller | |
run: npm install --save-dev @electron/lint-roller@^2.1.0 | |
- name: Run markdownlint | |
run: npx electron-markdownlint --fix "**/*.md" | |
- name: Lint JS in Markdown with standard | |
run: npx lint-roller-markdown-standard --ignore-path .markdownlintignore --semi --fix "**/*.md" | |
- name: Push Any Changes | |
run: | | |
rm -rf node_modules | |
rm -f package.json | |
rm -f package-lock.json | |
git add . | |
if test -n "$(git status -s)"; then | |
git diff --cached | |
git commit -m "chore: auto-fix lint" | |
git push origin HEAD:$GITHUB_REF | |
else | |
echo No changes to push | |
fi |