-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (47 loc) · 1.54 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: build
on:
pull_request: {}
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
self_mutation_happened: ${{ steps.self_mutation.outputs.self_mutation_happened }}
env:
CI: "true"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: build
run: |
chmod +x src/build.sh
src/build.sh
- id: self_mutation
name: Find mutations
run: |-
git add .
git diff --staged --patch --exit-code > .repo.patch || echo "::set-output name=self_mutation_happened::true"
- if: steps.self_mutation.outputs.self_mutation_happened
name: Upload patch
uses: actions/upload-artifact@v2
with:
name: .repo.patch
path: .repo.patch
- if: steps.self_mutation.outputs.self_mutation_happened
name: Upload layer
uses: actions/upload-artifact@v2
with:
name: layer.zip
path: src/layer.zip
# - name: Fail build on mutation
# if: steps.self_mutation.outputs.self_mutation_happened
# run: |-
# echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch."
# cat .repo.patch
# exit 1