Skip to content

Commit 46cfe2d

Browse files
committed
Add release integrity checksums
1 parent a66f877 commit 46cfe2d

4 files changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release integrity
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: Release tag to package
11+
required: true
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
package-release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out release ref
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.release.tag_name || inputs.tag }}
24+
25+
- name: Build release archive
26+
run: |
27+
set -euo pipefail
28+
tag="${{ github.event.release.tag_name || inputs.tag }}"
29+
archive="SecuritySkills-${tag}.tar.gz"
30+
mkdir -p dist
31+
git archive --format=tar.gz --prefix="SecuritySkills-${tag}/" -o "dist/${archive}" HEAD
32+
cd dist
33+
sha256sum "${archive}" > SHA256SUMS
34+
35+
- name: Attach checksum artifacts to release
36+
if: github.event_name == 'release'
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
run: |
40+
set -euo pipefail
41+
gh release upload "${{ github.event.release.tag_name }}" dist/* --clobber
42+
43+
- name: Upload workflow artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: release-integrity-artifacts
47+
path: dist/*

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ If your contribution changes CI/CD examples, update
180180
ruby scripts/validate_ci_cd_examples.rb
181181
```
182182

183+
Release artifacts are checksummed by the GitHub release workflow. See
184+
[docs/release-integrity.md](docs/release-integrity.md) before changing release
185+
packaging.
186+
183187
### Normalized JSON output
184188

185189
Every skill must be able to emit findings as normalized JSON that validates

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ ruby scripts/validate_framework_registry.rb
126126
ruby scripts/validate_framework_registry.rb --stale --max-age-days 365
127127
```
128128

129+
Release archives include SHA-256 checksums generated by the release workflow.
130+
See [`docs/release-integrity.md`](docs/release-integrity.md) for verification
131+
steps.
132+
129133
CI/CD examples for GitHub Actions, GitLab CI, Azure DevOps, Jenkins,
130134
pre-commit, and local agent usage are available in
131135
[`docs/ci-cd-examples.md`](docs/ci-cd-examples.md). Validate those examples

docs/release-integrity.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Release Integrity
2+
3+
Release artifacts are produced by the `Release integrity` GitHub Actions
4+
workflow. When a GitHub release is published, the workflow creates:
5+
6+
- `SecuritySkills-<tag>.tar.gz`: archive built from the release tag.
7+
- `SHA256SUMS`: SHA-256 checksum file for the archive.
8+
9+
Both files are attached to the GitHub release. The workflow can also be run
10+
manually with a tag through `workflow_dispatch`; manual runs upload the same
11+
files as workflow artifacts for review.
12+
13+
## Verify A Release
14+
15+
Download the release archive and `SHA256SUMS`, then run:
16+
17+
```bash
18+
sha256sum -c SHA256SUMS
19+
```
20+
21+
Expected output:
22+
23+
```text
24+
SecuritySkills-<tag>.tar.gz: OK
25+
```
26+
27+
This repository currently provides checksum-based release integrity. If a future
28+
release process adds key-managed artifact signing, keep checksum generation in
29+
place so consumers can verify artifacts even when they do not participate in the
30+
signing trust chain.

0 commit comments

Comments
 (0)