Skip to content

Commit b78883d

Browse files
feat: Add attestations (#58)
* feat: Add attestations * Trial attestation * fix: Permissions * feat: Add attestation on main only * docs: Mention how to verify downloads
1 parent 0dfece9 commit b78883d

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
},
1111
"ghcr.io/guiyomh/features/golangci-lint:0": {
1212
"version": "latest"
13+
},
14+
"ghcr.io/devcontainers/features/github-cli:1": {
15+
"installDirectlyFromGitHubRelease": true,
16+
"version": "latest"
1317
}
1418
}
1519

.github/workflows/commit-all.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
goarch:
1616
- amd64
1717
- arm64
18-
uses: PossibleLlama/workflows/.github/workflows/[email protected].15
18+
uses: PossibleLlama/workflows/.github/workflows/[email protected].16
1919
with:
2020
source-path: "./exec/cli/main.go"
2121
build-flags: "-ldflags=\"-w -s -X 'main.VERSION=$(git rev-list -1 HEAD)'\""

.github/workflows/commit-main.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ jobs:
2020
goarch:
2121
- amd64
2222
- arm64
23-
uses: PossibleLlama/workflows/.github/workflows/[email protected]
23+
uses: PossibleLlama/workflows/.github/workflows/[email protected]
24+
permissions:
25+
id-token: write
26+
contents: read
27+
attestations: write
2428
with:
2529
source-path: "./exec/cli/main.go"
2630
build-flags: "-ldflags=\"-w -s -X 'main.VERSION=$(git rev-list -1 HEAD)'\""
2731
os: ${{ matrix.goos }}
2832
arch: ${{ matrix.goarch }}
2933
retention-days: 30
34+
attestation: true
3035

3136
security:
3237
name: Security checks

docs/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,27 @@ Required configuration:
9292

9393
Optional configuration:
9494
- `assignee` - Filter the card to only those assigned this email.
95+
96+
## Verification
97+
98+
To verify that the downloaded artifacts were built from
99+
this repository, you can run a check using the [Github CLI](https://cli.github.com/manual/gh_attestation_verify).
100+
101+
If these commands fail, it indicates that they were not
102+
built correctly, and it's advised that you download the
103+
artifacts directly from the [releases page](https://github.com/PossibleLlama/commit-check/releases).
104+
105+
To verify that the downloaded artifact originates from
106+
this repo, you can run the following against the binary.
107+
108+
``` bash
109+
gh attestation verify --owner "PossibleLlama" commit-check.bin
110+
```
111+
112+
The build uses [this reusable workflow](https://github.com/PossibleLlama/workflows/blob/main/.github/workflows/golang-binary.yaml),
113+
and as such the build can be verified that it was built
114+
from that workflow.
115+
116+
```bash
117+
Run gh attestation verify --owner PossibleLlama --signer-workflow "PossibleLlama/workflows/.github/workflows/golang-binary.yaml" commit-check-linux-amd64.bin
118+
```

0 commit comments

Comments
 (0)