Skip to content

Add temporary fixed-target retired image package cleanup - #52

Merged
xnoto merged 2 commits into
mainfrom
prepare/delete-retired-sms-package
Sep 20, 2026
Merged

xnoto merged 2 commits into
mainfrom
prepare/delete-retired-sms-package

Conversation

@xnoto

@xnoto xnoto commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Owner specifically approved creating, merging, manually running, and then removing this temporary cleanup workflow. Fixed target: organization container package opencode-sms-bridge associated with makeitworkcloud/images. Whole-package deletion, not just versions. No arbitrary input.

Fixes: N/A — final full-retirement cleanup.

Type of change

  • CI / reusable workflow
  • Breaking change

Validation

  • Required PR checks pass — pending.
  • No generated files hand-edited.

Adversarial/security/delivery reviews ADVANCE after raw Octokit package-name encoding correction. Runtime self-check verifies exact single encoding before API access. Org inventory, metadata identity/type/repository association and version inventory precede DELETE; GET404 plus relisted absence verify result. Current GITHUB_TOKEN package-admin access is tested at execution, not assumed as success.

Impact and rollout

Manual workflow_dispatch only, main/exact repository guards, zero inputs, fixed concurrency, five-minute timeout, pinned GitHub-maintained github-script; contents read/packages write only. No PR/push deletion, new PAT or external credentials. Source/runtime consumers already removed. After approved dispatch and verified deletion, remove this workflow in an immediate follow-up. GitHub package retention/restore/download-threshold rules still apply; failures stop without bypass.

Owner/maintainer: makeitworkcloud images. Existing workflows cannot delete packages; whole-package REST through existing publisher token is the approved narrow mechanism. Historical source does not republish package.

Safety and secrets

  • No token/secret contents, raw state or sensitive plans
  • No local OpenTofu/state operations
  • Exact destructive scope and mandatory removal described above

AI-assisted. Owner expressly authorized merge, dispatch and removal after verification. No upstream communications.

Adds the owner-approved TEMPORARY manual-only workflow
.github/workflows/delete-retired-sms-package.yml for the retired
container package opencode-sms-bridge (source removed in d833bb6).
workflow_dispatch with no inputs; runs only on
makeitworkcloud/images@refs/heads/main; default GITHUB_TOKEN with
contents:read and packages:write (this publishing repository holds
admin on the package). The script resolves the package through the
paginated org inventory, verifies id, name, package_type, and the
exact repository association fail-closed before deleting the entire
package, then confirms the result with a 404 GET plus an inventory
relist. Absence after a successful inventory GET is success, so the
run is idempotent on re-dispatch. actions/github-script is pinned to
the verified v9.0.0 commit 3a2844b7e9c422d3c10d287c895573f7108da1b3
already used by buildah.yml.

No dispatch, merge, or package deletion happens in this commit; the
buildah publication workflow and its triggers are unchanged. Public
packages over 5000 downloads are refused by GitHub and not bypassed;
deleted packages remain restorable for 30 days. Remove this workflow
after the confirmed cleanup run.
Adversarial review confirmed the structured Octokit REST methods encode
route parameters themselves: octokit/endpoint.js builds URLs through
its url-template util, whose encodeValue() applies encodeURIComponent
(encodeUnreserved) to simple {name} placeholders such as {package_name}
(source: octokit/endpoint.js src/util/url-template.ts). Passing a
pre-encoded name would double-encode the slash (for example
charts%252F...). Remove the encodedName variable and its incorrect
comment and pass the raw package name to the metadata GET, the version
list, the package DELETE, and the post-delete GET.

Add a pre-request self-check that fails before any API call unless
github.request.endpoint('GET /orgs/{org}/packages/{package_type}/{package_name}',
{...}) builds a URL whose pathname, read via new URL(), equals the
singly encoded /orgs/<owner>/packages/container/<encodeURIComponent(name)>
path. Only non-secret path names appear in the failure message; no
tokens are logged. The actions/github-script pin is unchanged.

No dispatch, merge, or live API execution happens in this commit.
@xnoto
xnoto requested a review from a team as a code owner September 20, 2026 05:25
@github-actions

Copy link
Copy Markdown

Image CI passed

Pre-commit validation passed. View the workflow run.

@xnoto
xnoto merged commit 1c4d9a1 into main Sep 20, 2026
5 checks passed
@xnoto
xnoto deleted the prepare/delete-retired-sms-package branch September 20, 2026 05:30
xnoto added a commit that referenced this pull request Sep 20, 2026
## Summary

Fix the approved temporary package-cleanup workflow after its first run
failed on org-wide inventory HTTP400 before issuing any DELETE. Use the
narrower exact-package metadata endpoint instead; fixed target and
repository association checks remain mandatory.

Fixes: N/A — follows #52.

## Type of change

- [x] Bug fix
- [x] CI / reusable workflow

## Validation

- [ ] Required PR checks pass — pending.
- [x] No generated files hand-edited.

Adversarial/security/delivery reviews ADVANCE. Initial metadata errors
including404 fail closed; validate positive ID, exact name/type/producer
repository before version inventory and whole-package DELETE. After
accepted delete, at most5 GETs confirm404; other errors fail. Same
pinned action, once-encoding check, permissions, repo/main guards,
timeout, concurrency, zero inputs. No PAT fallback or raw error-header
logging.

## Impact and rollout

No deletion on PR/push. Owner-approved main dispatch still targets only
opencode-sms-bridge. Previous failed run deleted nothing. After verified
success, remove temporary workflow immediately. No other package/API
privilege or repository setting change.

## Safety and secrets

- [x] No credentials, state, or sensitive plans
- [x] No local OpenTofu/state operations
- [x] Fixed destructive scope and disarm requirement unchanged

AI-assisted; no upstream communications.
xnoto added a commit that referenced this pull request Sep 20, 2026
## Summary

Replace unavailable Octokit deletePackageForOrganization helper with
documented whole-package REST DELETE and require204. Previous approved
run verified exact package/repository metadata and13versions, then
failed before any DELETE.

Fixes: N/A — completes approved temporary cleanup from #52/#53.

## Type of change

- [x] Bug fix
- [x] CI / reusable workflow

## Validation

- [ ] Required PR checks pass — pending.
- [x] No generated files hand-edited.

Adversarial/security/delivery reviewers ADVANCE. Only DELETE invocation
changes; fixed target, action pin, permissions, zero-input manual-main
guards, metadata validation, once-encoding check and bounded
post-delete404 verification unchanged.

## Impact and rollout

Owner-approved merge/dispatch targets only opencode-sms-bridge. Require
metadata success, DELETE204, then GET404. No other API permissions or
package targets. Delete temporary workflow immediately after verified
success. No source/image publication involved.

## Safety and secrets

- [x] No credentials, state, or sensitive plans
- [x] No local OpenTofu/state operations
- [x] Fixed scope and mandatory disarm preserved

AI-assisted; no upstream communications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant