mirror of
https://github.com/immich-app/immich.git
synced 2025-09-14 16:18:18 -04:00
58 lines
1.7 KiB
YAML
58 lines
1.7 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@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
|
|
with:
|
|
app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }}
|
|
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
|
|
|
|
- name: 'Checkout'
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
token: ${{ steps.generate-token.outputs.token }}
|
|
persist-credentials: true
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.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@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.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'
|
|
})
|