-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3e5460
commit b0d2417
Showing
2 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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 | ||
- 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 | ||
- name: Run markdownlint | ||
run: npx electron-markdownlint --fix "**/*.md" | ||
- name: Lint JS in Markdown with standard | ||
run: npx electron-lint-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 |
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