mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
name: Fix formatting
|
|
|
|
on:
|
|
pull_request:
|
|
types: [labeled]
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
fix-formatting:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.label.name == 'fix:formatting' }}
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Generate a token
|
|
id: generate-token
|
|
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
|
|
with:
|
|
app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }}
|
|
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
|
|
|
|
- name: 'Checkout'
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
token: ${{ steps.generate-token.outputs.token }}
|
|
persist-credentials: true
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
|
with:
|
|
node-version-file: './server/.nvmrc'
|
|
cache: 'pnpm'
|
|
cache-dependency-path: '**/pnpm-lock.yaml'
|
|
|
|
- name: Fix formatting
|
|
run: make install-all && make format-all
|
|
|
|
- name: Commit and push
|
|
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
|
|
with:
|
|
default_author: github_actions
|
|
message: 'chore: fix formatting'
|
|
|
|
- name: Remove label
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
if: always()
|
|
with:
|
|
script: |
|
|
github.rest.issues.removeLabel({
|
|
issue_number: context.payload.pull_request.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: 'fix:formatting'
|
|
})
|