Add formatting and eslint pipeline #1
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: Prettier & Lint | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: "ui/package-lock.json" | |
- name: Install dependencies | |
working-directory: ui | |
run: npm ci | |
- name: Run formatter | |
working-directory: ui | |
run: npm run format | |
- name: add and commit any files that have changed | |
id: add_and_commit | |
uses: EndBug/add-and-commit@c8bfb4ff65642c4c54445500822f6e7da558994a | |
with: | |
message: "🤖 GITHUB ACTIONS format_prettier" | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
- name: cancel run if commit is done so the second run is used | |
run: | | |
if ${{ steps.add_and_commit.outputs.committed }};then | |
gh run cancel ${{ github.run_id }} | |
fi | |
env: | |
GH_TOKEN: ${{ github.token }} |