Skip to content

Commit c3044a6

Browse files
authored
Merge pull request #13 from auths-dev/dev-actionConsistency
Dev action consistency
2 parents 615d251 + d4c3d7e commit c3044a6

7 files changed

Lines changed: 75 additions & 76 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,47 +41,46 @@ jobs:
4141
4242
- name: Sign dist/index.js
4343
env:
44-
AUTHS_PASSPHRASE: ${{ secrets.AUTHS_CI_PASSPHRASE }}
45-
AUTHS_CI_KEYCHAIN_B64: ${{ secrets.AUTHS_CI_KEYCHAIN }}
46-
AUTHS_CI_IDENTITY_BUNDLE_B64: ${{ secrets.AUTHS_CI_IDENTITY_BUNDLE }}
44+
AUTHS_CI_TOKEN: ${{ secrets.AUTHS_CI_TOKEN }}
4745
AUTHS_KEYCHAIN_BACKEND: file
4846
AUTHS_KEYCHAIN_FILE: /tmp/auths-ci-keychain
4947
run: |
50-
if [ -z "$AUTHS_PASSPHRASE" ] || [ -z "$AUTHS_CI_KEYCHAIN_B64" ] || [ -z "$AUTHS_CI_IDENTITY_BUNDLE_B64" ]; then
51-
echo "::warning::Skipping artifact signing: AUTHS_CI_PASSPHRASE, AUTHS_CI_KEYCHAIN, and AUTHS_CI_IDENTITY_BUNDLE must all be set"
48+
if [ -z "$AUTHS_CI_TOKEN" ]; then
49+
echo "::warning::Skipping artifact signing: AUTHS_CI_TOKEN not set (run 'auths ci setup' to configure)"
5250
exit 0
5351
fi
5452
55-
printf '%s' "$AUTHS_CI_KEYCHAIN_B64" | tr -d '[:space:]' | base64 -d > /tmp/auths-ci-keychain
56-
mkdir -p /tmp/auths-identity
57-
printf '%s' "$AUTHS_CI_IDENTITY_BUNDLE_B64" | tr -d '[:space:]' | base64 -d | tar -xz -C /tmp/auths-identity
53+
# Extract fields from the single CI token
54+
AUTHS_PASSPHRASE=$(echo "$AUTHS_CI_TOKEN" | jq -r '.passphrase')
55+
echo "::add-mask::$AUTHS_PASSPHRASE"
56+
export AUTHS_PASSPHRASE
5857
59-
# Find the actual .auths dir (may be nested as .auths/ inside the tarball)
60-
if [ -d /tmp/auths-identity/.auths ]; then
61-
AUTHS_REPO=/tmp/auths-identity/.auths
62-
else
63-
AUTHS_REPO=/tmp/auths-identity
64-
fi
58+
echo "$AUTHS_CI_TOKEN" | jq -r '.keychain' | base64 -d > /tmp/auths-ci-keychain
59+
mkdir -p /tmp/auths-identity
60+
echo "$AUTHS_CI_TOKEN" | jq -r '.identity_repo' | base64 -d | tar -xz -C /tmp/auths-identity
6561
66-
if ! git -C "$AUTHS_REPO" rev-parse --git-dir > /dev/null 2>&1; then
67-
echo "::warning::Skipping artifact signing: AUTHS_CI_IDENTITY_BUNDLE does not contain a valid git repository"
62+
if ! git -C /tmp/auths-identity rev-parse --git-dir > /dev/null 2>&1; then
63+
echo "::warning::Skipping artifact signing: identity repo in AUTHS_CI_TOKEN is not a valid git repository"
6864
exit 0
6965
fi
7066
7167
auths artifact sign dist/index.js \
7268
--device-key ci-release-device \
7369
--note "GitHub Actions release — ${GITHUB_REF_NAME}" \
74-
--repo "$AUTHS_REPO"
70+
--repo /tmp/auths-identity
7571
7672
echo "Signed dist/index.js → dist/index.js.auths.json"
7773
74+
# Write verify bundle for next step
75+
echo "$AUTHS_CI_TOKEN" | jq -r '.verify_bundle' > /tmp/auths-verify-bundle.json
76+
7877
# --- Verify the artifact we just signed (dogfood) ---
7978
- name: Verify dist/index.js attestation
8079
if: hashFiles('dist/index.js.auths.json') != ''
8180
uses: ./
8281
with:
83-
identity: ${{ secrets.AUTHS_CI_IDENTITY_BUNDLE_JSON }}
84-
artifact-paths: 'dist/index.js'
82+
token: /tmp/auths-verify-bundle.json
83+
files: 'dist/index.js'
8584
fail-on-unattested: true
8685
fail-on-unsigned: false
8786

@@ -110,17 +109,17 @@ jobs:
110109
### Usage
111110
112111
```yaml
113-
- uses: auths-dev/verify@${{ github.ref_name }}
112+
- uses: auths-dev/verify@v1
114113
with:
115-
identity: '.auths/allowed_signers'
114+
token: '.auths/allowed_signers'
116115
```
117116
118117
**New: Artifact verification**
119118
```yaml
120-
- uses: auths-dev/verify@${{ github.ref_name }}
119+
- uses: auths-dev/verify@v1
121120
with:
122-
identity: ${{ secrets.AUTHS_IDENTITY_BUNDLE }}
123-
artifact-paths: 'dist/*.tar.gz'
121+
token: $\{{ secrets.AUTHS_CI_TOKEN }}
122+
files: 'dist/*.tar.gz'
124123
```
125124
126125
See the [README](https://github.com/auths-dev/verify#readme) for full configuration options.

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Auths Verify Action
22

3-
Verify commit signatures using [Auths](https://github.com/auths-dev/auths) identity keys. Ensures every commit in a PR or push is cryptographically signed by an authorized developer.
3+
Verify commit signatures using [Auths](https://github.com/auths-dev/auths) token keys. Ensures every commit in a PR or push is cryptographically signed by an authorized developer.
44

55
## Quickstart
66

@@ -11,7 +11,7 @@ Verify commit signatures using [Auths](https://github.com/auths-dev/auths) ident
1111
- uses: auths-dev/verify@v1
1212
```
1313
14-
That's it. The action auto-detects the commit range from the GitHub event (PR or push), downloads the `auths` CLI, and verifies each commit. Identity is auto-detected from the `identity` input (defaults to `.auths/allowed_signers`).
14+
That's it. The action auto-detects the commit range from the GitHub event (PR or push), downloads the `auths` CLI, and verifies each commit. Identity is auto-detected from the `token` input (defaults to `.auths/allowed_signers`).
1515

1616
## Features
1717

@@ -29,18 +29,18 @@ That's it. The action auto-detects the commit range from the GitHub event (PR or
2929

3030
| Input | Description | Required | Default |
3131
|-------|-------------|----------|---------|
32-
| `identity` | Identity for verification. Accepts: CI token JSON, identity bundle JSON, file path to bundle, or path to allowed_signers file | No | `.auths/allowed_signers` (auto) |
33-
| `commit-range` | Git commit range to verify (e.g. `HEAD~5..HEAD`) | No | Auto-detected from event |
32+
| `token` | Identity for verification. Accepts: CI token JSON, identity bundle JSON, file path to bundle, or path to allowed_signers file | No | `.auths/allowed_signers` (auto) |
33+
| `commits` | Git commit range to verify (e.g. `HEAD~5..HEAD`) | No | Auto-detected from event |
3434
| `auths-version` | Auths CLI version to use (e.g. `0.5.0`) | No | `''` (latest) |
3535
| `fail-on-unsigned` | Whether to fail the action if unsigned commits are found | No | `true` |
3636
| `skip-merge-commits` | Whether to skip merge commits during verification | No | `true` |
3737
| `post-pr-comment` | Post a PR comment with results and fix instructions (requires `pull-requests: write`) | No | `false` |
3838
| `github-token` | GitHub token for posting the PR comment (required when `post-pr-comment: true`) | No | `''` |
39-
| `artifact-paths` | Glob patterns for artifact files to verify, one per line | No | `''` |
39+
| `files` | Glob patterns for artifact files to verify, one per line | No | `''` |
4040
| `artifact-attestation-dir` | Directory containing `.auths.json` attestation files | No | `''` |
4141
| `fail-on-unattested` | Fail the action if any artifact lacks a valid attestation | No | `true` |
4242

43-
The `identity` input auto-detects the format. When empty, it defaults to the `.auths/allowed_signers` file. When only `artifact-paths` is set with an identity bundle, commit verification is skipped automatically.
43+
The `token` input auto-detects the format. When empty, it defaults to the `.auths/allowed_signers` file. When only `files` is set with an identity bundle, commit verification is skipped automatically.
4444

4545
## Outputs
4646

@@ -54,11 +54,11 @@ The `identity` input auto-detects the format. When empty, it defaults to the `.a
5454

5555
## Verification Modes
5656

57-
The `identity` input auto-detects the format:
57+
The `token` input auto-detects the format:
5858

5959
### Allowed Signers File (default)
6060

61-
Commit the team's public keys to your repo. When `identity` is empty, the action looks for `.auths/allowed_signers`:
61+
Commit the team's public keys to your repo. When `token` is empty, the action looks for `.auths/allowed_signers`:
6262

6363
```
6464
# .auths/allowed_signers
@@ -75,7 +75,7 @@ Or pass a custom path:
7575
```yaml
7676
- uses: auths-dev/verify@v1
7777
with:
78-
identity: 'path/to/allowed_signers'
78+
token: 'path/to/allowed_signers'
7979
```
8080

8181
### Identity Bundle (stateless CI)
@@ -92,15 +92,15 @@ Then pass the secret directly — the action detects the JSON format automatical
9292
```yaml
9393
- uses: auths-dev/verify@v1
9494
with:
95-
identity: ${{ secrets.AUTHS_IDENTITY_BUNDLE }}
95+
token: ${{ secrets.AUTHS_IDENTITY_BUNDLE }}
9696
```
9797

9898
Or commit the bundle (it contains only public data) and reference the file:
9999

100100
```yaml
101101
- uses: auths-dev/verify@v1
102102
with:
103-
identity: '.auths/identity-bundle.json'
103+
token: '.auths/token-bundle.json'
104104
```
105105

106106
## Example Workflows
@@ -141,7 +141,7 @@ jobs:
141141
142142
- uses: auths-dev/verify@v1
143143
with:
144-
identity: ${{ secrets.AUTHS_IDENTITY_BUNDLE }}
144+
token: ${{ secrets.AUTHS_IDENTITY_BUNDLE }}
145145
```
146146

147147
### Non-blocking (Warn Only)
@@ -215,7 +215,7 @@ jobs:
215215
216216
- uses: auths-dev/verify@v1
217217
with:
218-
identity: ${{ secrets.AUTHS_IDENTITY_BUNDLE }}
218+
token: ${{ secrets.AUTHS_IDENTITY_BUNDLE }}
219219
fail-on-unsigned: ${{ inputs.mode == 'enforce' && 'true' || 'false' }}
220220
```
221221

@@ -254,6 +254,6 @@ Apache-2.0. See [LICENSE](LICENSE).
254254

255255
## Links
256256

257-
- [Auths](https://github.com/auths-dev/auths) - Decentralized identity for developers
257+
- [Auths](https://github.com/auths-dev/auths) - Decentralized token for developers
258258
- [Auths CLI](https://github.com/auths-dev/auths/tree/main/crates/auths-cli) - Command-line tool
259259
- [Signing commits with Auths](https://github.com/auths-dev/auths#readme) - Setup guide

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ description: 'Verify commit signatures and artifact attestations using Auths ide
33
author: 'auths'
44

55
inputs:
6-
identity:
6+
token:
77
description: 'Identity for verification. Accepts: AUTHS_CI_TOKEN JSON, identity bundle JSON, file path to bundle, or path to allowed_signers file. Default: .auths/allowed_signers'
88
required: false
99
default: ''
10-
commit-range:
10+
commits:
1111
description: 'Git commit range to verify (defaults to PR commits or push commits)'
1212
required: false
1313
default: ''
@@ -31,7 +31,7 @@ inputs:
3131
description: 'GitHub token used to post the PR comment (required when post-pr-comment is true)'
3232
required: false
3333
default: ''
34-
artifact-paths:
34+
files:
3535
description: 'Glob patterns for artifact files to verify, one per line (e.g., "dist/*.tar.gz")'
3636
required: false
3737
default: ''

dist/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71413,11 +71413,11 @@ async function run() {
7141371413
// Run pre-flight checks (shallow clone, ssh-keygen)
7141471414
await (0, verifier_1.runPreflightChecks)();
7141571415
// Get inputs
71416-
const identityInput = core.getInput('identity');
71417-
let commitRange = core.getInput('commit-range');
71416+
const identityInput = core.getInput('token');
71417+
let commitRange = core.getInput('commits');
7141871418
const failOnUnsigned = core.getInput('fail-on-unsigned') === 'true';
7141971419
const skipMergeCommits = core.getInput('skip-merge-commits') !== 'false';
71420-
const artifactPathPatterns = core.getMultilineInput('artifact-paths');
71420+
const artifactPathPatterns = core.getMultilineInput('files');
7142171421
const artifactAttestationDir = core.getInput('artifact-attestation-dir');
7142271422
const failOnUnattested = core.getInput('fail-on-unattested') !== 'false';
7142371423
// Resolve identity (auto-detects format)
@@ -71561,7 +71561,7 @@ async function run() {
7156171561
// Deduplicate
7156271562
files = [...new Set(files)];
7156371563
if (files.length === 0) {
71564-
core.warning('artifact-paths provided but no files matched');
71564+
core.warning('files provided but no artifacts matched');
7156571565
}
7156671566
for (const file of files) {
7156771567
core.info(`Verifying artifact: ${path.basename(file)}`);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__tests__/artifact-integration.test.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,19 @@ jest.mock('../verifier', () => {
111111

112112
function resetMockState() {
113113
mockInputs = {
114-
'identity': '',
115-
'commit-range': 'HEAD^..HEAD',
114+
'token': '',
115+
'commits': 'HEAD^..HEAD',
116116
'fail-on-unsigned': 'true',
117117
'skip-merge-commits': 'true',
118118
'auths-version': '',
119119
'post-pr-comment': 'false',
120120
'github-token': '',
121-
'artifact-paths': '',
121+
'files': '',
122122
'artifact-attestation-dir': '',
123123
'fail-on-unattested': 'true',
124124
};
125125
mockMultilineInputs = {
126-
'artifact-paths': [],
126+
'files': [],
127127
};
128128
mockOutputs = {};
129129
mockFailed = [];
@@ -154,8 +154,8 @@ describe('Artifact verification integration', () => {
154154
jest.clearAllMocks();
155155
});
156156

157-
it('does no artifact work when artifact-paths is empty', async () => {
158-
mockMultilineInputs['artifact-paths'] = [];
157+
it('does no artifact work when files is empty', async () => {
158+
mockMultilineInputs['files'] = [];
159159

160160
await runMain();
161161

@@ -164,9 +164,9 @@ describe('Artifact verification integration', () => {
164164
expect(mockOutputs['artifacts-verified']).toBe('');
165165
});
166166

167-
it('verifies artifacts when artifact-paths provided', async () => {
168-
mockMultilineInputs['artifact-paths'] = ['dist/*.tar.gz'];
169-
mockInputs['identity'] = '/tmp/bundle.json';
167+
it('verifies artifacts when files provided', async () => {
168+
mockMultilineInputs['files'] = ['dist/*.tar.gz'];
169+
mockInputs['token'] = '/tmp/bundle.json';
170170
mockGlobFiles = ['/workspace/dist/app.tar.gz'];
171171

172172
mockVerifyArtifact.mockResolvedValue({
@@ -191,20 +191,20 @@ describe('Artifact verification integration', () => {
191191
expect(results[0].valid).toBe(true);
192192
});
193193

194-
it('emits warning when artifact-paths matches no files', async () => {
195-
mockMultilineInputs['artifact-paths'] = ['nonexistent/*.tar.gz'];
196-
mockInputs['identity'] = '/tmp/bundle.json';
194+
it('emits warning when files matches no artifacts', async () => {
195+
mockMultilineInputs['files'] = ['nonexistent/*.tar.gz'];
196+
mockInputs['token'] = '/tmp/bundle.json';
197197
mockGlobFiles = [];
198198

199199
await runMain();
200200

201201
expect(mockVerifyArtifact).not.toHaveBeenCalled();
202-
expect(mockWarnings).toContain('artifact-paths provided but no files matched');
202+
expect(mockWarnings).toContain('files provided but no artifacts matched');
203203
});
204204

205205
it('fails when fail-on-unattested is true and artifact fails', async () => {
206-
mockMultilineInputs['artifact-paths'] = ['dist/*.tar.gz'];
207-
mockInputs['identity'] = '/tmp/bundle.json';
206+
mockMultilineInputs['files'] = ['dist/*.tar.gz'];
207+
mockInputs['token'] = '/tmp/bundle.json';
208208
mockGlobFiles = ['/workspace/dist/bad.tar.gz'];
209209

210210
mockVerifyArtifact.mockResolvedValue({
@@ -224,8 +224,8 @@ describe('Artifact verification integration', () => {
224224
});
225225

226226
it('does not fail when fail-on-unattested is false', async () => {
227-
mockMultilineInputs['artifact-paths'] = ['dist/*.tar.gz'];
228-
mockInputs['identity'] = '/tmp/bundle.json';
227+
mockMultilineInputs['files'] = ['dist/*.tar.gz'];
228+
mockInputs['token'] = '/tmp/bundle.json';
229229
mockInputs['fail-on-unattested'] = 'false';
230230
mockGlobFiles = ['/workspace/dist/bad.tar.gz'];
231231

@@ -247,10 +247,10 @@ describe('Artifact verification integration', () => {
247247
expect(artifactFailures).toHaveLength(0);
248248
});
249249

250-
it('fails when no identity bundle provided for artifact verification', async () => {
251-
mockMultilineInputs['artifact-paths'] = ['dist/*.tar.gz'];
250+
it('fails when no token provided for artifact verification', async () => {
251+
mockMultilineInputs['files'] = ['dist/*.tar.gz'];
252252
// No identity bundle set — defaults to allowed-signers
253-
mockInputs['identity'] = '';
253+
mockInputs['token'] = '';
254254
mockGlobFiles = ['/workspace/dist/app.tar.gz'];
255255

256256
await runMain();
@@ -262,8 +262,8 @@ describe('Artifact verification integration', () => {
262262
});
263263

264264
it('handles partial success correctly', async () => {
265-
mockMultilineInputs['artifact-paths'] = ['dist/*'];
266-
mockInputs['identity'] = '/tmp/bundle.json';
265+
mockMultilineInputs['files'] = ['dist/*'];
266+
mockInputs['token'] = '/tmp/bundle.json';
267267
mockGlobFiles = ['/workspace/dist/good.tar.gz', '/workspace/dist/bad.tar.gz'];
268268

269269
mockVerifyArtifact
@@ -293,8 +293,8 @@ describe('Artifact verification integration', () => {
293293
});
294294

295295
it('filters paths outside workspace', async () => {
296-
mockMultilineInputs['artifact-paths'] = ['**/*.tar.gz'];
297-
mockInputs['identity'] = '/tmp/bundle.json';
296+
mockMultilineInputs['files'] = ['**/*.tar.gz'];
297+
mockInputs['token'] = '/tmp/bundle.json';
298298
mockGlobFiles = ['/workspace/dist/good.tar.gz', '/etc/passwd.tar.gz'];
299299

300300
mockVerifyArtifact.mockResolvedValue({
@@ -317,8 +317,8 @@ describe('Artifact verification integration', () => {
317317
});
318318

319319
it('deduplicates glob results', async () => {
320-
mockMultilineInputs['artifact-paths'] = ['dist/*.tar.gz', 'dist/app.tar.gz'];
321-
mockInputs['identity'] = '/tmp/bundle.json';
320+
mockMultilineInputs['files'] = ['dist/*.tar.gz', 'dist/app.tar.gz'];
321+
mockInputs['token'] = '/tmp/bundle.json';
322322
// Glob returns the same file twice from two patterns
323323
mockGlobFiles = ['/workspace/dist/app.tar.gz', '/workspace/dist/app.tar.gz'];
324324

src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ async function run(): Promise<void> {
7979
await runPreflightChecks();
8080

8181
// Get inputs
82-
const identityInput = core.getInput('identity');
83-
let commitRange = core.getInput('commit-range');
82+
const identityInput = core.getInput('token');
83+
let commitRange = core.getInput('commits');
8484
const failOnUnsigned = core.getInput('fail-on-unsigned') === 'true';
8585
const skipMergeCommits = core.getInput('skip-merge-commits') !== 'false';
86-
const artifactPathPatterns = core.getMultilineInput('artifact-paths');
86+
const artifactPathPatterns = core.getMultilineInput('files');
8787
const artifactAttestationDir = core.getInput('artifact-attestation-dir');
8888
const failOnUnattested = core.getInput('fail-on-unattested') !== 'false';
8989

@@ -247,7 +247,7 @@ async function run(): Promise<void> {
247247
files = [...new Set(files)];
248248

249249
if (files.length === 0) {
250-
core.warning('artifact-paths provided but no files matched');
250+
core.warning('files provided but no artifacts matched');
251251
}
252252

253253
for (const file of files) {

0 commit comments

Comments
 (0)