Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/lstt-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ name: LSTT Formatting

on:
workflow_dispatch:
push:
branches:
- develop
paths:
- ".github/workflows/lstt-formatting.yml"
- "projects/rdc/**"
- "projects/amdsmi/**"
- "projects/rocm-smi-lib/**"
- "!**/*.md"
- "!**/*.rtf"
- "!**/*.rst"
- "!**/.readthedocs.yaml"
pull_request:
paths:
- ".github/workflows/lstt-formatting.yml"
Expand All @@ -18,7 +30,8 @@ permissions:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Every merged commit needs its own verdict, so only PR pushes supersede.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
pre-commit:
Expand Down Expand Up @@ -47,9 +60,13 @@ jobs:

- name: Run pre-commit
working-directory: projects/${{ matrix.project }}
env:
FROM_REF: >-
${{ github.event_name == 'push' && github.event.before
|| format('origin/{0}', github.event.pull_request.base.ref || 'develop') }}
run: >
pre-commit run
--show-diff-on-failure
--color=always
--from-ref origin/${{ github.event.pull_request.base.ref || 'develop' }}
--from-ref "$FROM_REF"
--to-ref HEAD
Loading