Skip to content

Merge pull request #2 from metorikhq/v2 #2

Merge pull request #2 from metorikhq/v2

Merge pull request #2 from metorikhq/v2 #2

Workflow file for this run

name: Prettier (JS)
on:
push:
branches:
- "master"
- "main"
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
prettier:
name: Prettier (JS)
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Get changed js/vue files
id: changed-files-specific
uses: tj-actions/changed-files@v44
with:
files: |
**.js
**.vue
- name: Prettify code
if: steps.changed-files-specific.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files-specific.outputs.all_changed_files }}
run: |
echo "Files that have changed: $ALL_CHANGED_FILES"
npx prettier --write $ALL_CHANGED_FILES
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Prettier: auto-formatting"