Add initial version of the action and associated files #3
Workflow file for this run
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: ESLint Check | |
on: [push, pull_request] | |
jobs: | |
eslint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "21" | |
- name: Install dependencies | |
run: npm install | |
- name: Run ESLint | |
id: eslint | |
run: | | |
npx eslint . | |
# This step will fail when running with ACT | |
- name: Generate git am command | |
if: failure() | |
run: | | |
npx eslint . --fix | |
git add . | |
git commit -m "ESLint fixes" | |
git format-patch -1 HEAD --stdout | base64 > patch.base64 | |
echo "Run the following command locally to apply the fixes:" | |
echo "base64 -d patch.base64 | git am" |