Read delivery tokens from files and check selected paths before release
This commit is contained in:
@@ -98,6 +98,13 @@ The `Candidate` supplies both `RepositoryDir` and `ModuleDir`, plus the declared
|
||||
module-local product checks. ReleaseKit calls `AdditionalChecks` once after
|
||||
shared validation when supplied.
|
||||
|
||||
For local token files, set `Validation.UntrackedFiles` to the repository-relative
|
||||
paths that should stay out of the committed candidate, such as
|
||||
`[]string{".releasekit/gitea-token"}`. Failures use `untracked-files` and carry the
|
||||
selected committed paths in `ValidationError.Findings`. This selection is
|
||||
independent of module and shared-file inputs; see [GoDoc](../../check.go) for
|
||||
the API contract and the [configuration reference](../config.md) for CLI use.
|
||||
|
||||
`ValidationSpec.SharedFiles` adds committed, repository-relative files to
|
||||
ReleaseKit's optional file checks without enabling any checks. A nil slice
|
||||
selects the optional defaults `COPYRIGHT`, `LICENSE`, and
|
||||
|
||||
@@ -77,11 +77,36 @@ git checkout --detach v1.2.3
|
||||
RELEASEKIT_GITEA_TOKEN="$GITEA_TOKEN" releasekit deliver v1.2.3
|
||||
```
|
||||
|
||||
The CLI reads the named token variable only for `deliver`; its default name is
|
||||
`RELEASEKIT_GITEA_TOKEN`. It verifies the local checkout and hosted tag before
|
||||
The CLI resolves the token for delivery using the configured environment
|
||||
variable or token file. It verifies the local checkout and hosted tag before
|
||||
creating or accepting a hosted release page. The full checked-in note is the
|
||||
hosted body. A retry accepts an identical page and matching attachments, adds
|
||||
only missing assets, and reports conflicts without replacing content.
|
||||
|
||||
For local delivery, save a Gitea personal access token in a git-ignored file such
|
||||
as `.releasekit/gitea-token` and configure:
|
||||
|
||||
```json
|
||||
{
|
||||
"product": "Example",
|
||||
"validation": {
|
||||
"untracked_files": [".releasekit/gitea-token"]
|
||||
},
|
||||
"delivery": {
|
||||
"base_url": "https://gitea.example",
|
||||
"owner": "example",
|
||||
"repository": "example",
|
||||
"token_file": ".releasekit/gitea-token"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Add `.releasekit/` to the consumer's ignore rules and use owner-only file
|
||||
permissions for the saved token. Then run `releasekit deliver v1.2.3` from the
|
||||
tagged checkout. CI can continue supplying the environment token. See the
|
||||
[configuration reference](../config.md) for precedence, path resolution, and the
|
||||
optional candidate check. The validator checks the selected committed paths;
|
||||
it does not scan for secrets in other files or past commits.
|
||||
For nested modules, the note comes from that module's committed
|
||||
`docs/releases/<version>.md`, and the hosted page is keyed by its complete tag.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user