ghcr-manager 0.9.0 → 0.9.2
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/CHANGELOG.md +12 -0
- package/README.md +11 -11
- package/dist/cli/_args.d.ts +1 -1
- package/dist/cli/_args.js +1 -1
- package/dist/cli/_cleanup-command.js +2 -2
- package/dist/cli/_scan-command.js +2 -2
- package/dist/cli/_untag-command.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.9.2] - 2026-05-21
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- The action input is now `token`, and the repo now uses `GITHUB_TOKEN` consistently in docs and helper scripts.
|
|
15
|
+
|
|
16
|
+
## [0.9.1] - 2026-05-21
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- The GitHub Action now installs, builds, and runs from its own checkout path instead of the caller repository path.
|
|
21
|
+
|
|
10
22
|
## [0.9.0] - 2026-05-21
|
|
11
23
|
|
|
12
24
|
`0.9.0` is the first stable pre-`1.0` release of `ghcr-manager`.
|
package/README.md
CHANGED
|
@@ -33,10 +33,10 @@ jobs:
|
|
|
33
33
|
|
|
34
34
|
- name: Preview GHCR cleanup
|
|
35
35
|
id: ghcr-manager
|
|
36
|
-
uses: gh-workflow/ghcr-manager@0.9.
|
|
36
|
+
uses: gh-workflow/ghcr-manager@0.9.2
|
|
37
37
|
with:
|
|
38
38
|
command: cleanup
|
|
39
|
-
|
|
39
|
+
token: ${{ github.token }}
|
|
40
40
|
owner: OWNER
|
|
41
41
|
package: PACKAGE
|
|
42
42
|
dry-run: true
|
|
@@ -72,10 +72,10 @@ The action supports three commands:
|
|
|
72
72
|
### Preview cleanup
|
|
73
73
|
|
|
74
74
|
```yaml
|
|
75
|
-
- uses: gh-workflow/ghcr-manager@0.9.
|
|
75
|
+
- uses: gh-workflow/ghcr-manager@0.9.2
|
|
76
76
|
with:
|
|
77
77
|
command: cleanup
|
|
78
|
-
|
|
78
|
+
token: ${{ github.token }}
|
|
79
79
|
owner: OWNER
|
|
80
80
|
package: PACKAGE
|
|
81
81
|
dry-run: true
|
|
@@ -93,10 +93,10 @@ The action supports three commands:
|
|
|
93
93
|
### Apply cleanup
|
|
94
94
|
|
|
95
95
|
```yaml
|
|
96
|
-
- uses: gh-workflow/ghcr-manager@0.9.
|
|
96
|
+
- uses: gh-workflow/ghcr-manager@0.9.2
|
|
97
97
|
with:
|
|
98
98
|
command: cleanup
|
|
99
|
-
|
|
99
|
+
token: ${{ github.token }}
|
|
100
100
|
owner: OWNER
|
|
101
101
|
package: PACKAGE
|
|
102
102
|
delete-untagged: true
|
|
@@ -112,10 +112,10 @@ Note: the second scan only runs if cleanup actually makes changes.
|
|
|
112
112
|
### Remove selected tags directly
|
|
113
113
|
|
|
114
114
|
```yaml
|
|
115
|
-
- uses: gh-workflow/ghcr-manager@0.9.
|
|
115
|
+
- uses: gh-workflow/ghcr-manager@0.9.2
|
|
116
116
|
with:
|
|
117
117
|
command: untag
|
|
118
|
-
|
|
118
|
+
token: ${{ github.token }}
|
|
119
119
|
owner: OWNER
|
|
120
120
|
package: PACKAGE
|
|
121
121
|
delete-tags: |
|
|
@@ -128,10 +128,10 @@ Note: the second scan only runs if cleanup actually makes changes.
|
|
|
128
128
|
### Scan one package
|
|
129
129
|
|
|
130
130
|
```yaml
|
|
131
|
-
- uses: gh-workflow/ghcr-manager@0.9.
|
|
131
|
+
- uses: gh-workflow/ghcr-manager@0.9.2
|
|
132
132
|
with:
|
|
133
133
|
command: scan
|
|
134
|
-
|
|
134
|
+
token: ${{ github.token }}
|
|
135
135
|
owner: OWNER
|
|
136
136
|
package: PACKAGE
|
|
137
137
|
```
|
|
@@ -145,7 +145,7 @@ Note: the second scan only runs if cleanup actually makes changes.
|
|
|
145
145
|
| Input | Description | Cmds | Required | Default |
|
|
146
146
|
| ---------------------------- | ----------------------------------- | ---- | ----------- | ------------------------------ |
|
|
147
147
|
| `command` | `scan`, `cleanup`, or `untag` | all | Yes | |
|
|
148
|
-
| `
|
|
148
|
+
| `token` | GitHub token for API calls | all | Yes | `${{ github.token }}` |
|
|
149
149
|
| `owner` | Package owner | all | Yes | |
|
|
150
150
|
| `package` | Package name | all | Yes | |
|
|
151
151
|
| `db-path` | Local SQLite DB path | s,c | No | |
|
package/dist/cli/_args.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export declare function requireOption(args: string[], name: string): string;
|
|
|
3
3
|
export declare function findOption(args: string[], name: string): string | undefined;
|
|
4
4
|
export declare function collectRepeatedOption(args: string[], name: string): string[];
|
|
5
5
|
export declare function hasFlag(args: string[], name: string): boolean;
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function resolveToken(args: string[]): string;
|
|
7
7
|
export declare function resolveLogLevel(args: string[]): LogLevel;
|
package/dist/cli/_args.js
CHANGED
|
@@ -25,7 +25,7 @@ export function collectRepeatedOption(args, name) {
|
|
|
25
25
|
export function hasFlag(args, name) {
|
|
26
26
|
return args.includes(name);
|
|
27
27
|
}
|
|
28
|
-
export function
|
|
28
|
+
export function resolveToken(args) {
|
|
29
29
|
const cliToken = findOption(args, "--token");
|
|
30
30
|
if (cliToken) {
|
|
31
31
|
return cliToken;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { buildCleanupSummary } from "../cleanup-summary/index.js";
|
|
2
2
|
import { CleanupRunWriter, openDatabase, PlannerRepository } from "../db/index.js";
|
|
3
3
|
import { executeDeletePlan } from "../execute/index.js";
|
|
4
|
-
import { hasFlag,
|
|
4
|
+
import { hasFlag, resolveLogLevel, resolveToken } from "./_args.js";
|
|
5
5
|
import { createLogger } from "./_logger.js";
|
|
6
6
|
import { loadDeletePlan, resolvePlanCommandInputs } from "./_planner-options.js";
|
|
7
7
|
import { resolveTagSelectors } from "./_tag-selector-resolver.js";
|
|
8
8
|
export async function handleCleanup(args) {
|
|
9
9
|
const inputs = resolvePlanCommandInputs(args);
|
|
10
10
|
const dryRun = hasFlag(args, "--dry-run");
|
|
11
|
-
const token = dryRun ? undefined :
|
|
11
|
+
const token = dryRun ? undefined : resolveToken(args);
|
|
12
12
|
const logger = createLogger(resolveLogLevel(args));
|
|
13
13
|
const database = openDatabase(inputs.databasePath);
|
|
14
14
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScanWriter, SnapshotRepository, openDatabase } from "../db/index.js";
|
|
2
2
|
import { importGitHubScan } from "../ingest/github/index.js";
|
|
3
|
-
import { findOption, requireOption,
|
|
3
|
+
import { findOption, requireOption, resolveLogLevel, resolveToken } from "./_args.js";
|
|
4
4
|
import { writeGitHubScanOutputs } from "./_github-output.js";
|
|
5
5
|
import { createLogger } from "./_logger.js";
|
|
6
6
|
export async function handleScan(args) {
|
|
@@ -8,7 +8,7 @@ export async function handleScan(args) {
|
|
|
8
8
|
const owner = requireOption(args, "--owner");
|
|
9
9
|
const packageName = requireOption(args, "--package");
|
|
10
10
|
const githubOutputPath = findOption(args, "--github-output");
|
|
11
|
-
const token =
|
|
11
|
+
const token = resolveToken(args);
|
|
12
12
|
const logger = createLogger(resolveLogLevel(args));
|
|
13
13
|
const database = openDatabase(databasePath);
|
|
14
14
|
const repository = new SnapshotRepository(database);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { listPackageVersionTagSources, untagRootTags } from "../execute/index.js";
|
|
2
|
-
import { collectRepeatedOption, hasFlag, requireOption,
|
|
2
|
+
import { collectRepeatedOption, hasFlag, requireOption, resolveLogLevel, resolveToken } from "./_args.js";
|
|
3
3
|
import { createLogger } from "./_logger.js";
|
|
4
4
|
export async function handleUntag(args) {
|
|
5
5
|
const owner = requireOption(args, "--owner");
|
|
@@ -8,7 +8,7 @@ export async function handleUntag(args) {
|
|
|
8
8
|
if (requestedTags.length === 0) {
|
|
9
9
|
throw new Error("missing required option: --tag");
|
|
10
10
|
}
|
|
11
|
-
const token =
|
|
11
|
+
const token = resolveToken(args);
|
|
12
12
|
const dryRun = hasFlag(args, "--dry-run");
|
|
13
13
|
const logger = createLogger(resolveLogLevel(args));
|
|
14
14
|
const tagSources = await listPackageVersionTagSources(owner, packageName, requestedTags, token, logger);
|