本番リリース #137
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: Lint and Format | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
lint-and-format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Run ESLint | |
run: | | |
npm run lint | |
git add . | |
if ! git diff --exit-code; then | |
echo "ESLint changes detected. Please commit the changes." | |
exit 1 | |
fi | |
- name: Run Prettier | |
run: | | |
npm run format | |
git add . | |
if ! git diff --exit-code; then | |
echo "Prettier changes detected. Please commit the changes." | |
exit 1 | |
fi |