Skip to content

Add formatting and eslint pipeline #3

Add formatting and eslint pipeline

Add formatting and eslint pipeline #3

name: Format
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 prettier
working-directory: ui
run: npm run prettier: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 }}