-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathe2e.nodejs.push.main.adversarial.slsa3.yml
More file actions
81 lines (70 loc) · 2.9 KB
/
e2e.nodejs.push.main.adversarial.slsa3.yml
File metadata and controls
81 lines (70 loc) · 2.9 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
push:
branches: [main]
paths:
- "e2e/e2e.nodejs.push.main.adversarial.slsa3.yml.txt"
permissions: read-all
concurrency: "e2e-nodejs-push-main-adversarial-slsa3"
env:
GH_TOKEN: ${{ secrets.E2E_NODEJS_TOKEN }}
ISSUE_REPOSITORY: slsa-framework/slsa-github-generator
jobs:
# Bootstrap
################################################################################
bootstrap:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Bumps the package version pushes, creates a git tag, and pushes the tag.
- run: ./.github/workflows/scripts/e2e-bootstrap.sh
if-bootstrap-failed:
runs-on: ubuntu-latest
needs: [bootstrap]
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && needs.bootstrap.result != 'success'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: ./.github/workflows/scripts/e2e-report-failure.sh
# Main workflow
################################################################################
# Shim determines if the rest of the workflow should run.
# NOTE: it should only use the `if` to determine this and all downstream jobs
# should depend on this job.
shim:
# NOTE: this must be kept in sync with the if-failed job.
if: github.event_name == 'push' && github.event.head_commit.message == github.workflow
runs-on: ubuntu-latest
steps:
- run: |
echo "event: ${GITHUB_EVENT_NAME}"
echo "ref: ${GITHUB_REF}"
adversarial-cmd:
needs: [shim]
permissions:
id-token: write # For signing.
contents: read # For repo checkout of private repos.
actions: read # For getting workflow run on private repos.
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@main
with:
directory: e2e/nodejs/e2e-nodejs-push-main-adversarial-slsa3
node-version: 20
run-scripts: "ci;pwd"
if-succeeded:
needs: [adversarial-cmd]
runs-on: ubuntu-latest
if: always() && github.event_name == 'push' && github.event.head_commit.message == github.workflow && needs.adversarial-cmd.result == 'failure'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: ./.github/workflows/scripts/e2e-report-success.sh
if-failed:
needs: [adversarial-cmd]
runs-on: ubuntu-latest
if: always() && github.event_name == 'push' && github.event.head_commit.message == github.workflow && needs.adversarial-cmd.result != 'failure'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: ./.github/workflows/scripts/e2e-report-failure.sh