File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 actions : read
2626 contents : read
2727 runs-on : ubuntu-latest
28+ outputs :
29+ self_mutation_happened : ${{ steps.self_mutation.outputs.self_mutation_happened }}
2830 steps :
2931 - name : Checkout
3032 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3840
3941 - name : Build
4042 run : mise run build
43+
44+ - name : Find mutations
45+ id : self_mutation
46+ run : |-
47+ git add .
48+ git diff --staged --patch --exit-code > repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT
49+ shell : bash
50+ working-directory : ./
51+
52+ - name : Upload patch
53+ if : steps.self_mutation.outputs.self_mutation_happened
54+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.4.0
55+ with :
56+ name : repo.patch
57+ path : repo.patch
58+ overwrite : true
59+
60+ - name : Fail build on mutation
61+ if : steps.self_mutation.outputs.self_mutation_happened
62+ run : |-
63+ echo "::error::Files were changed during build (see build log). Please run the build locally and commit the changes."
64+ cat repo.patch
65+ exit 1
You can’t perform that action at this time.
0 commit comments