-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (34 loc) · 1.09 KB
/
e2e.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
name: Go push main
on:
push:
branches: [ main ]
permissions: read-all
env:
TARGET_REPOSITORY: laurentsimon/slsa-on-github-test # TODO: update with slsa go
ISSUE_TITLE: "E2E failure: Go push main"
jobs:
#TODO: support multiple config files.
build:
runs-on: ubuntu-latest
steps:
- run: |
echo hello
exit -1
run-if-failed:
runs-on: ubuntu-latest
needs: build
if: always() && (needs.build.result == 'failure')
env:
GH_TOKEN: ${{ secrets.E2E_TOKEN }}
steps:
- run: |
#TODO: create issue on the repo about the failure.
cat << EOF > BODY
Repo: https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_REF_NAME
Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Workflow name: Go push main
Workflow file: https://github.com/${{ github.repository }}/tree/main/.github/workflows/e2e.yml
Trigger: push
Branch: main
EOF
gh issue create -t "$ISSUE_TITLE" -F ./BODY -R "$TARGET_REPOSITORY"