Skip to content

Commit d6589a0

Browse files
committed
chore: add release audit workflow
Add GitHub Actions workflow to generate audit events for release branches. Made-with: Cursor
1 parent d9fb7cb commit d6589a0

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: release-audit
2+
3+
on:
4+
push:
5+
branches:
6+
- "release/v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
write-audit-event:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Generate audit event
19+
run: |
20+
mkdir -p release
21+
ts="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
22+
service="${GITHUB_REPOSITORY##*/}"
23+
version="${GITHUB_REF_NAME#release/}"
24+
25+
jq -n \
26+
--arg service "$service" \
27+
--arg environment "unknown" \
28+
--arg version "$version" \
29+
--arg commit "$GITHUB_SHA" \
30+
--arg release_branch "$GITHUB_REF_NAME" \
31+
--arg pipeline_run_id "$GITHUB_RUN_ID" \
32+
--arg requested_by "$GITHUB_ACTOR" \
33+
--arg status "created" \
34+
--arg timestamp "$ts" \
35+
'{
36+
service: $service,
37+
environment: $environment,
38+
version: $version,
39+
commit: $commit,
40+
release_branch: $release_branch,
41+
pipeline_run_id: $pipeline_run_id,
42+
approvers: [],
43+
requested_by: $requested_by,
44+
status: $status,
45+
timestamp: $timestamp
46+
}' >> release/audit-log.jsonl
47+
48+
- name: Upload audit log artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: release-audit-log
52+
path: release/audit-log.jsonl
53+

0 commit comments

Comments
 (0)