@ligeti/workflow-attest-and-publish 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +86 -2
- package/dist/store.d.ts +9 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +15 -0
- package/dist/store.js.map +1 -0
- package/dist/workflow.d.ts +74 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.js +171 -0
- package/dist/workflow.js.map +1 -0
- package/package.json +27 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Viktor "Bika" Nagy
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,87 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ligeti/workflow-attest-and-publish
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runs the verification gate for one commit of a target repository and, only if it passes, publishes the signed
|
|
4
|
+
attestation -- to a GitLab project's generic package registry or as a git note on the repository's
|
|
5
|
+
remote. A failed gate is never published. See
|
|
6
|
+
[`docs/attestation.md`](../../docs/attestation.md) for what the gate proves, what it does not, and
|
|
7
|
+
the trust model behind signing and publishing -- this README covers only the workflow's own
|
|
8
|
+
surface.
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
|
|
12
|
+
| Input | Required | Default | Notes |
|
|
13
|
+
| ------------------- | -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| `repoPath` | yes | -- | Path to the local repository the commit is cloned from; the gate never runs in it. |
|
|
15
|
+
| `commit` | yes | -- | The commit to gate: a sha, or a commit-ish the shell resolves in `repoPath` once. |
|
|
16
|
+
| `configPath` | no | -- | Path to the gate config. Defaults to the shell's own default gate config path when omitted. |
|
|
17
|
+
| `base` | no | -- | A commit-ish whose merge-base with `commit` bounds the changed files. A check whose `paths` match none of them reports `skipped_not_applicable`. Every check runs when omitted. |
|
|
18
|
+
| `store` | no | by host | `gitlab-registry` or `git-notes`; see [Choosing the store](#choosing-the-store). |
|
|
19
|
+
| `remote` | no | `origin` | Name of the git remote whose URL picks the store and which `git-notes` publishes to; a leading `-`, whitespace, `..`, `@` or a URL is rejected at input validation. |
|
|
20
|
+
| `projectUrl` | gitlab-registry only | -- | The GitLab project to publish the attestation to. Required when the store is `gitlab-registry`; the run fails before the gate when it is missing. |
|
|
21
|
+
| `minRemainingHours` | no | `0` | How much of `maxAgeHours` an attestation already published for this sha must have left to be kept; less makes the workflow delete the attestation and publish again. |
|
|
22
|
+
| `replace` | no | `false` | Replace whatever attestation is already published for this sha, however fresh it looks: `git-notes` overwrites the note, `gitlab-registry` deletes the package first and publishes once. |
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
{
|
|
28
|
+
runOutcome: "passed" | "failed"; // the gate's predicate.result
|
|
29
|
+
commitSha: string;
|
|
30
|
+
predicate: GatePredicate; // { result: "passed" | "failed"; checks: CheckResult[]; ... }
|
|
31
|
+
publish?: // present only when the gate passed
|
|
32
|
+
| { store: "gitlab-registry"; status: "published" | "already-published"; url: string; packageFile?: ... }
|
|
33
|
+
| { store: "git-notes"; status: "published" | "already-published"; remote: string; ref: string; sha: string };
|
|
34
|
+
failedChecks?: { id: string; stderr: string }[]; // only when the gate failed
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Choosing the store
|
|
39
|
+
|
|
40
|
+
With `store` omitted, the workflow reads `remote`'s URL in `repoPath` (`git.remote-url`) and applies
|
|
41
|
+
one rule: a host that is exactly `gitlab.com` publishes to the `gitlab-registry`, any other host --
|
|
42
|
+
GitHub, a self-hosted GitLab, a local path -- to `git-notes`. Nothing else is guessed: a
|
|
43
|
+
self-hosted GitLab gets `git-notes` unless the caller passes `store: "gitlab-registry"` (and
|
|
44
|
+
`projectUrl`). When that rule picks `git-notes` and `projectUrl` was given, the run fails before the gate: a GitLab
|
|
45
|
+
reached through an SSH host alias is not recognised, so pass `store: "gitlab-registry"` or drop
|
|
46
|
+
`projectUrl`. Passing `store` skips reading the URL. The host rule is `src/store.ts`; the Rules are
|
|
47
|
+
in [`test/store.feature`](test/store.feature).
|
|
48
|
+
|
|
49
|
+
With `git-notes`, `git-notes-attestation.publish` writes the envelope as a note on the commit under
|
|
50
|
+
`refs/notes/ligeti-attestations` and pushes that ref to `remote`; it replaces a stale note itself, so
|
|
51
|
+
the delete-and-publish-again path below belongs to `gitlab-registry` only. See
|
|
52
|
+
[`steps/git-notes-attestation/README.md`](../../steps/git-notes-attestation/README.md).
|
|
53
|
+
|
|
54
|
+
A stale registry attestation (see [`steps/gitlab-registry/README.md`](../../steps/gitlab-registry/README.md))
|
|
55
|
+
is deleted with `gitlabRegistryDeleteAttestation` and published once more; the workflow fails if the
|
|
56
|
+
second publish is still stale. `publish.status` is therefore never `"stale"`.
|
|
57
|
+
|
|
58
|
+
`predicate` is always present. `publish` is present only when `predicate.result` is `"passed"` --
|
|
59
|
+
a failed gate returns `runOutcome`, `commitSha`, `predicate` and `failedChecks`, with no publish
|
|
60
|
+
attempt. `failedChecks` lists, in predicate order, each required gate check that did not pass with
|
|
61
|
+
the tail of its stderr (the last 4000 characters, prefixed with `...` when cut).
|
|
62
|
+
Either way the run ends with a `done` status carrying the same `runOutcome`.
|
|
63
|
+
|
|
64
|
+
## Steps
|
|
65
|
+
|
|
66
|
+
1. `@ligeti/step-git-worktree`'s `gitRemoteUrl` -- only when `store` is omitted: reads the remote's URL.
|
|
67
|
+
2. `@ligeti/step-attest`'s `attestGate` -- runs the gate for `commit` in a fresh gate checkout and
|
|
68
|
+
returns a signed envelope plus the commit sha, predicate and the gate config's `maxAgeHours`. See
|
|
69
|
+
[`steps/attest/README.md`](../../steps/attest/README.md).
|
|
70
|
+
3. `@ligeti/step-gitlab-registry`'s `gitlabRegistryPublishAttestation` -- publishes that envelope,
|
|
71
|
+
keyed by `commitSha`, to the GitLab project's generic package registry. Run only when the gate
|
|
72
|
+
passed. See [`steps/gitlab-registry/README.md`](../../steps/gitlab-registry/README.md).
|
|
73
|
+
4. `gitlabRegistryDeleteAttestation` -- run only when the publish reported the attestation stale or `replace` is true.
|
|
74
|
+
5. `@ligeti/step-git-notes-attestation`'s `gitNotesAttestationPublish` -- instead of steps 3 and 4
|
|
75
|
+
when the store is `git-notes`.
|
|
76
|
+
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
This workflow reads no environment variables directly. Signing, GitLab credentials and the git
|
|
80
|
+
credentials used to push notes are the composed steps' concern; see [`steps/attest/README.md`](../../steps/attest/README.md) and
|
|
81
|
+
[`steps/gitlab-registry/README.md`](../../steps/gitlab-registry/README.md) for their environment
|
|
82
|
+
variables, and [`docs/attestation.md`](../../docs/attestation.md) for the trust boundary the
|
|
83
|
+
signing key sits behind.
|
|
84
|
+
|
|
85
|
+
This is one of the default workflows: `ligeti serve` offers it while `LIGETI_WORKFLOWS` is unset.
|
|
86
|
+
Setting `LIGETI_WORKFLOWS` replaces the default list, so it must then list this directory too (see
|
|
87
|
+
[ADR-0029](../../adr/0029-ligeti-installs-from-npm-with-per-user-config-and-state-directories.md)).
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "@ligeti/sdk";
|
|
2
|
+
export declare const AttestationStore: z.ZodEnum<{
|
|
3
|
+
"gitlab-registry": "gitlab-registry";
|
|
4
|
+
"git-notes": "git-notes";
|
|
5
|
+
}>;
|
|
6
|
+
export type AttestationStore = z.infer<typeof AttestationStore>;
|
|
7
|
+
export declare function remoteHost(remoteUrl: string): string | undefined;
|
|
8
|
+
export declare function storeForRemoteUrl(remoteUrl: string): AttestationStore;
|
|
9
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,eAAO,MAAM,gBAAgB;;;EAA2C,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAMhE,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIhE;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAErE"}
|
package/dist/store.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// ABOUTME: The attestation store a repository's attestations are published to, and the host rule that
|
|
2
|
+
// ABOUTME: picks it from the repository's remote URL: gitlab.com means the registry, any other host git notes.
|
|
3
|
+
import { z } from "@ligeti/sdk";
|
|
4
|
+
export const AttestationStore = z.enum(["gitlab-registry", "git-notes"]);
|
|
5
|
+
const URL_FORM = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/(?:[^@/]*@)?(\[[^\]]+\]|[^/:@]+)(?::\d*)?(?:[/?#]|$)/;
|
|
6
|
+
const SCP_FORM = /^(?:[^@/:]+@)?([^/:@]+):/;
|
|
7
|
+
export function remoteHost(remoteUrl) {
|
|
8
|
+
const url = remoteUrl.trim();
|
|
9
|
+
const match = URL_FORM.exec(url) ?? (url.includes("://") ? null : SCP_FORM.exec(url));
|
|
10
|
+
return match?.[1]?.toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
export function storeForRemoteUrl(remoteUrl) {
|
|
13
|
+
return remoteHost(remoteUrl) === "gitlab.com" ? "gitlab-registry" : "git-notes";
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,+GAA+G;AAC/G,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC;AAGzE,MAAM,QAAQ,GACZ,mFAAmF,CAAC;AACtF,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAE5C,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACtF,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,UAAU,CAAC,SAAS,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "@ligeti/sdk";
|
|
2
|
+
declare const _default: import("@ligeti/sdk").WorkflowDefinition<z.ZodObject<{
|
|
3
|
+
repoPath: z.ZodString;
|
|
4
|
+
commit: z.ZodString;
|
|
5
|
+
configPath: z.ZodOptional<z.ZodString>;
|
|
6
|
+
base: z.ZodOptional<z.ZodString>;
|
|
7
|
+
store: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
"gitlab-registry": "gitlab-registry";
|
|
9
|
+
"git-notes": "git-notes";
|
|
10
|
+
}>>;
|
|
11
|
+
remote: z.ZodOptional<z.ZodString>;
|
|
12
|
+
projectUrl: z.ZodOptional<z.ZodString>;
|
|
13
|
+
minRemainingHours: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
replace: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
runOutcome: z.ZodEnum<{
|
|
17
|
+
passed: "passed";
|
|
18
|
+
failed: "failed";
|
|
19
|
+
}>;
|
|
20
|
+
commitSha: z.ZodString;
|
|
21
|
+
predicate: z.ZodObject<{
|
|
22
|
+
result: z.ZodEnum<{
|
|
23
|
+
passed: "passed";
|
|
24
|
+
failed: "failed";
|
|
25
|
+
}>;
|
|
26
|
+
mergeBase: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
status: z.ZodEnum<{
|
|
30
|
+
passed: "passed";
|
|
31
|
+
failed: "failed";
|
|
32
|
+
skipped_unmet_prerequisites: "skipped_unmet_prerequisites";
|
|
33
|
+
skipped_not_applicable: "skipped_not_applicable";
|
|
34
|
+
}>;
|
|
35
|
+
required: z.ZodBoolean;
|
|
36
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
durationMs: z.ZodNumber;
|
|
38
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$loose>>;
|
|
40
|
+
}, z.core.$loose>;
|
|
41
|
+
publish: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
|
+
url: z.ZodString;
|
|
43
|
+
packageFile: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
id: z.ZodNumber;
|
|
45
|
+
package_id: z.ZodNumber;
|
|
46
|
+
created_at: z.ZodString;
|
|
47
|
+
file_name: z.ZodString;
|
|
48
|
+
size: z.ZodNumber;
|
|
49
|
+
file_md5: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
file_sha1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
file_sha256: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
}, z.core.$loose>>;
|
|
53
|
+
store: z.ZodLiteral<"gitlab-registry">;
|
|
54
|
+
status: z.ZodEnum<{
|
|
55
|
+
published: "published";
|
|
56
|
+
"already-published": "already-published";
|
|
57
|
+
}>;
|
|
58
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
59
|
+
status: z.ZodEnum<{
|
|
60
|
+
published: "published";
|
|
61
|
+
"already-published": "already-published";
|
|
62
|
+
}>;
|
|
63
|
+
remote: z.ZodString;
|
|
64
|
+
ref: z.ZodString;
|
|
65
|
+
sha: z.ZodString;
|
|
66
|
+
store: z.ZodLiteral<"git-notes">;
|
|
67
|
+
}, z.core.$strict>], "store">>;
|
|
68
|
+
failedChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
stderr: z.ZodString;
|
|
71
|
+
}, z.core.$strip>>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
export default _default;
|
|
74
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,CAAC,EAAE,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ChD,wBAkLG"}
|
package/dist/workflow.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// ABOUTME: The attest-and-publish workflow: runs the gate for one commit of a repository, and, only when it
|
|
2
|
+
// ABOUTME: passes, publishes the signed attestation to a GitLab registry or a git note. A failed gate is never published.
|
|
3
|
+
import { defineWorkflow, z } from "@ligeti/sdk";
|
|
4
|
+
import { attestGate, AttestGateInput, GatePredicate } from "@ligeti/step-attest";
|
|
5
|
+
import { gitNotesAttestationPublish, GitNotesPublishOutput, isSafeRemoteName, } from "@ligeti/step-git-notes-attestation";
|
|
6
|
+
import { gitRemoteUrl } from "@ligeti/step-git-worktree";
|
|
7
|
+
import { gitlabRegistryDeleteAttestation, gitlabRegistryPublishAttestation, PublishAttestationInput, PublishAttestationOutput, } from "@ligeti/step-gitlab-registry";
|
|
8
|
+
import { AttestationStore, storeForRemoteUrl } from "./store.js";
|
|
9
|
+
const RegistryPublish = PublishAttestationOutput.extend({
|
|
10
|
+
store: z.literal("gitlab-registry"),
|
|
11
|
+
status: z.enum(["published", "already-published"]),
|
|
12
|
+
});
|
|
13
|
+
const NotesPublish = GitNotesPublishOutput.extend({ store: z.literal("git-notes") });
|
|
14
|
+
const PublishedAttestation = z.discriminatedUnion("store", [RegistryPublish, NotesPublish]);
|
|
15
|
+
const MAX_FAILED_CHECK_STDERR_CHARS = 4000;
|
|
16
|
+
const FailedCheck = z.object({ id: z.string(), stderr: z.string() });
|
|
17
|
+
function tail(text) {
|
|
18
|
+
return text.length > MAX_FAILED_CHECK_STDERR_CHARS
|
|
19
|
+
? `...${text.slice(text.length - MAX_FAILED_CHECK_STDERR_CHARS)}`
|
|
20
|
+
: text;
|
|
21
|
+
}
|
|
22
|
+
function isPublished(output) {
|
|
23
|
+
return output.status !== "stale";
|
|
24
|
+
}
|
|
25
|
+
export default defineWorkflow({
|
|
26
|
+
name: "attest-and-publish",
|
|
27
|
+
description: "Runs the gate for one commit of a repository in a fresh gate checkout, signs the " +
|
|
28
|
+
"attestation, and publishes it -- to a GitLab project's generic package registry or as a git " +
|
|
29
|
+
"note on the repository's remote -- but only when the gate passes.",
|
|
30
|
+
input: z.object({
|
|
31
|
+
repoPath: AttestGateInput.shape.repository.describe("Path to the local repository the commit is cloned from; the gate never runs in it"),
|
|
32
|
+
commit: AttestGateInput.shape.commit.describe("The commit to gate: a sha, or a commit-ish the shell resolves in the repository once"),
|
|
33
|
+
configPath: AttestGateInput.shape.configPath.describe("Path to the gate config. Defaults to the shell's own default gate config path when omitted"),
|
|
34
|
+
base: AttestGateInput.shape.base.describe("A commit-ish whose merge-base with the commit bounds the changed files; a check whose " +
|
|
35
|
+
"paths match none of them reports skipped_not_applicable. Every check runs when omitted"),
|
|
36
|
+
store: AttestationStore.optional().describe("Where to publish the attestation: gitlab-registry or git-notes. Defaults to gitlab-registry " +
|
|
37
|
+
"when the remote's host is gitlab.com and git-notes for any other host"),
|
|
38
|
+
remote: z
|
|
39
|
+
.string()
|
|
40
|
+
.min(1)
|
|
41
|
+
.refine(isSafeRemoteName, {
|
|
42
|
+
message: 'must be a safe remote name: no leading "-", no whitespace, no "..", and not a URL ' +
|
|
43
|
+
'(no "://" or "@")',
|
|
44
|
+
})
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("The name of the git remote whose URL picks the store and which git-notes publishes to. " +
|
|
47
|
+
"Defaults to origin"),
|
|
48
|
+
projectUrl: PublishAttestationInput.shape.projectUrl
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("The GitLab project to publish the attestation to; required for gitlab-registry"),
|
|
51
|
+
minRemainingHours: PublishAttestationInput.shape.minRemainingHours.describe("How many hours of maxAgeHours an attestation already published for this sha must have " +
|
|
52
|
+
"left to be kept. Defaults to 0"),
|
|
53
|
+
replace: z
|
|
54
|
+
.boolean()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Replace whatever attestation is already published for this sha, however fresh it " +
|
|
57
|
+
"looks: git-notes overwrites the note, gitlab-registry deletes the package and " +
|
|
58
|
+
"publishes again. Defaults to false"),
|
|
59
|
+
}),
|
|
60
|
+
output: z.object({
|
|
61
|
+
runOutcome: z.enum(["passed", "failed"]),
|
|
62
|
+
commitSha: z.string(),
|
|
63
|
+
predicate: GatePredicate,
|
|
64
|
+
publish: PublishedAttestation.optional(),
|
|
65
|
+
failedChecks: z.array(FailedCheck).optional(),
|
|
66
|
+
}),
|
|
67
|
+
steps: [
|
|
68
|
+
attestGate,
|
|
69
|
+
gitRemoteUrl,
|
|
70
|
+
gitlabRegistryPublishAttestation,
|
|
71
|
+
gitlabRegistryDeleteAttestation,
|
|
72
|
+
gitNotesAttestationPublish,
|
|
73
|
+
],
|
|
74
|
+
async run(ctx, { repoPath, commit, configPath, base, store, remote, projectUrl, minRemainingHours, replace }) {
|
|
75
|
+
const remoteName = remote ?? "origin";
|
|
76
|
+
let resolvedStore = store;
|
|
77
|
+
if (resolvedStore === undefined) {
|
|
78
|
+
const { url } = await ctx.run(gitRemoteUrl, { worktreePath: repoPath, remote: remoteName });
|
|
79
|
+
resolvedStore = storeForRemoteUrl(url);
|
|
80
|
+
if (resolvedStore === "git-notes" && projectUrl !== undefined) {
|
|
81
|
+
throw new Error(`attest-and-publish: projectUrl was given but the remote ${url} resolves to the git-notes ` +
|
|
82
|
+
'store; pass store: "gitlab-registry" to publish to the registry, or drop projectUrl');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (resolvedStore === "gitlab-registry" && projectUrl === undefined) {
|
|
86
|
+
throw new Error("attest-and-publish: the gitlab-registry store needs a projectUrl, and none was given");
|
|
87
|
+
}
|
|
88
|
+
await ctx.status("running-gate");
|
|
89
|
+
const gate = await ctx.run(attestGate, {
|
|
90
|
+
repository: repoPath,
|
|
91
|
+
commit,
|
|
92
|
+
...(configPath !== undefined ? { configPath } : {}),
|
|
93
|
+
...(base !== undefined ? { base } : {}),
|
|
94
|
+
});
|
|
95
|
+
if (gate.predicate.result !== "passed") {
|
|
96
|
+
await ctx.status("done", { runOutcome: "failed", result: gate.predicate.result });
|
|
97
|
+
return {
|
|
98
|
+
runOutcome: "failed",
|
|
99
|
+
commitSha: gate.commitSha,
|
|
100
|
+
predicate: gate.predicate,
|
|
101
|
+
failedChecks: gate.predicate.checks
|
|
102
|
+
.filter((check) => check.required &&
|
|
103
|
+
check.status !== "passed" &&
|
|
104
|
+
check.status !== "skipped_not_applicable")
|
|
105
|
+
.map((check) => ({
|
|
106
|
+
id: check.id,
|
|
107
|
+
stderr: tail(gate.checkOutputs.find((out) => out.id === check.id)?.stderr ?? ""),
|
|
108
|
+
})),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
await ctx.status("publishing");
|
|
112
|
+
let publish;
|
|
113
|
+
if (resolvedStore === "git-notes") {
|
|
114
|
+
const published = await ctx.run(gitNotesAttestationPublish, {
|
|
115
|
+
repoPath,
|
|
116
|
+
remote: remoteName,
|
|
117
|
+
sha: gate.commitSha,
|
|
118
|
+
envelope: gate.envelope,
|
|
119
|
+
maxAgeHours: gate.maxAgeHours,
|
|
120
|
+
...(minRemainingHours !== undefined ? { minRemainingHours } : {}),
|
|
121
|
+
...(replace === true ? { replace } : {}),
|
|
122
|
+
});
|
|
123
|
+
publish = { store: "git-notes", ...published };
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const registryProjectUrl = projectUrl ?? "";
|
|
127
|
+
const publishInput = {
|
|
128
|
+
projectUrl: registryProjectUrl,
|
|
129
|
+
sha: gate.commitSha,
|
|
130
|
+
envelope: gate.envelope,
|
|
131
|
+
maxAgeHours: gate.maxAgeHours,
|
|
132
|
+
...(minRemainingHours !== undefined ? { minRemainingHours } : {}),
|
|
133
|
+
};
|
|
134
|
+
if (replace === true) {
|
|
135
|
+
await ctx.status("replacing-stale-attestation");
|
|
136
|
+
await ctx.run(gitlabRegistryDeleteAttestation, {
|
|
137
|
+
projectUrl: registryProjectUrl,
|
|
138
|
+
sha: gate.commitSha,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
const first = await ctx.run(gitlabRegistryPublishAttestation, publishInput);
|
|
142
|
+
if (isPublished(first)) {
|
|
143
|
+
publish = { store: "gitlab-registry", ...first };
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
await ctx.status("replacing-stale-attestation");
|
|
147
|
+
await ctx.run(gitlabRegistryDeleteAttestation, {
|
|
148
|
+
projectUrl: registryProjectUrl,
|
|
149
|
+
sha: gate.commitSha,
|
|
150
|
+
});
|
|
151
|
+
const second = await ctx.run(gitlabRegistryPublishAttestation, publishInput);
|
|
152
|
+
if (!isPublished(second)) {
|
|
153
|
+
throw new Error(`the attestation for ${gate.commitSha} is still stale after it was deleted and published again`);
|
|
154
|
+
}
|
|
155
|
+
publish = { store: "gitlab-registry", ...second };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
await ctx.status("done", {
|
|
159
|
+
runOutcome: "passed",
|
|
160
|
+
result: gate.predicate.result,
|
|
161
|
+
publishStatus: publish.status,
|
|
162
|
+
});
|
|
163
|
+
return {
|
|
164
|
+
runOutcome: "passed",
|
|
165
|
+
commitSha: gate.commitSha,
|
|
166
|
+
predicate: gate.predicate,
|
|
167
|
+
publish,
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,0HAA0H;AAC1H,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,eAAe,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACtD,KAAK,EAAE,C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,CAAC;gBAC7E,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;oBACzB,MAAM,IAAI,KAAK,CACb,uBAAuB,IAAI,CAAC,SAAS,0DAA0D,CAChG,CAAC;gBACJ,CAAC;gBACD,OAAO,GAAG,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAAC;YACpD,CAAC;QACH,CAAC;QAED,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE;YACvB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;YAC7B,aAAa,EAAE,OAAO,CAAC,MAAM;SAC9B,CAAC,CAAC;QACH,OAAO;YACL,UAAU,EAAE,QAAiB;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO;SACR,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ligeti/workflow-attest-and-publish",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"ligeti": {
|
|
7
|
+
"kind": "workflow",
|
|
8
|
+
"entry": "./dist/workflow.js",
|
|
9
|
+
"sdk": "^2.0.0"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@ligeti/sdk": "2.3.0",
|
|
16
|
+
"@ligeti/step-attest": "3.1.2",
|
|
17
|
+
"@ligeti/step-git-notes-attestation": "1.0.1",
|
|
18
|
+
"@ligeti/step-git-worktree": "2.1.2",
|
|
19
|
+
"@ligeti/step-gitlab-registry": "2.1.2"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"ajv": "^8.20.0"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://gitlab.com/nagyv-projects/ligeti.git",
|
|
27
|
+
"directory": "workflows/attest-and-publish"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {}
|
|
6
30
|
}
|