Skip to content

Commit c3e9da6

Browse files
authored
ci: add daily SCM data gathering (#2498)
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
1 parent 5751fb0 commit c3e9da6

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Daily SCM Configuration Check
2+
3+
on:
4+
schedule:
5+
# Run daily at 9:00 AM UTC
6+
- cron: "0 9 * * *"
7+
workflow_dispatch: # Allow manual triggering
8+
9+
jobs:
10+
scm-configuration-check:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
env:
17+
CHAINLOOP_TOKEN: ${{ secrets.CHAINLOOP_TOKEN }}
18+
CHAINLOOP_WORKFLOW_NAME: scm-configuration-check
19+
CHAINLOOP_PROJECT_NAME: chainloop
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Chainloop
25+
run: |
26+
curl -sfL https://dl.chainloop.dev/cli/install.sh | bash -s
27+
28+
- name: Initialize Attestation
29+
run: |
30+
chainloop attestation init --workflow ${CHAINLOOP_WORKFLOW_NAME} --project ${CHAINLOOP_PROJECT_NAME}
31+
32+
- name: Gather runner context data
33+
run: |
34+
chainloop gather-runner-context --runner-token ${{ secrets.PAT_ADMIN }}
35+
36+
- name: Add runner context material to attestation
37+
run: |
38+
chainloop attestation add --name runner-context --value ./runner-context.json --kind CHAINLOOP_RUNNER_CONTEXT
39+
40+
- name: Finish and Record Attestation
41+
if: ${{ success() }}
42+
run: |
43+
chainloop attestation push --exception-bypass-policy-check
44+
45+
- name: Mark attestation as failed
46+
if: ${{ failure() }}
47+
run: |
48+
chainloop attestation reset
49+
50+
- name: Mark attestation as cancelled
51+
if: ${{ cancelled() }}
52+
run: |
53+
chainloop attestation reset --trigger cancellation

0 commit comments

Comments
 (0)