Skip to content

Commit 92ae4bf

Browse files
committed
Verify correct generated files in SCM
1 parent 1aea103 commit 92ae4bf

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Ensure no changes to tracked files
2+
description: Detect any changes to tracked files and fail the forkflow.
3+
inputs:
4+
post-pr-comment:
5+
description: Post a comment with changes (only on pull requests)
6+
required: false
7+
default: true
8+
comment-header:
9+
description: Header for the PR comment
10+
required: false
11+
default: "Tracked files have changed while running ${{ github.job.name }}:"
12+
comment-footer:
13+
description: Footer for the PR comment
14+
required: false
15+
default: ""
16+
runs:
17+
using: composite
18+
steps:
19+
- name: git diff
20+
id: git-diff
21+
uses: mathiasvr/command-output@v2
22+
with:
23+
shell: bash
24+
run: git diff --diff-algorithm=histogram --exit-code
25+
26+
- name: Post PR comment
27+
if: >-
28+
failure() &&
29+
github.event_name == 'pull_request' &&
30+
inputs.post-pr-comment == 'true'
31+
uses: thollander/actions-comment-pull-request@v3
32+
with:
33+
comment-tag: ${{ github.job }}
34+
message: |
35+
${{ inputs.comment-header }}
36+
```diff
37+
${{ steps.git-diff.outputs.stdout }}```
38+
${{ inputs.comment-footer }}

.github/workflows/build.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
name: package-sdist
3434
path: dist/*.tar.gz
3535

36+
- name: Ensure no changes to tracked files
37+
uses: ./.github/actions/ensure-no-diff
38+
3639
wheels:
3740
name: Binary wheels
3841
runs-on: ${{ matrix.os }}
@@ -73,3 +76,6 @@ jobs:
7376
with:
7477
name: package-wheels-${{matrix.os}}
7578
path: ./wheelhouse/*.whl
79+
80+
- name: Ensure no changes to tracked files
81+
uses: ./.github/actions/ensure-no-diff

0 commit comments

Comments
 (0)