Skip to content

feat: automate releases.json updates via GitHub Actions workflow#171

Merged
TerryHowe merged 1 commit into
mainfrom
feat/168-automate-releases-update
May 25, 2026
Merged

feat: automate releases.json updates via GitHub Actions workflow#171
TerryHowe merged 1 commit into
mainfrom
feat/168-automate-releases-update

Conversation

@TerryHowe

Copy link
Copy Markdown
Member

Summary

  • Adds .github/workflows/update-releases.yml — runs daily at 06:00 UTC and on workflow_dispatch. Detects new oras-project/oras releases that aren't yet in src/lib/data/releases.json, appends them, rebuilds dist/, and opens a PR via peter-evans/create-pull-request.
  • Adds .github/scripts/update-releases.mjs — the underlying Node script. Two modes:
    • Auto (no args): queries the GitHub releases API and adds only versions strictly newer than the current max in releases.json, so older 0.x releases the project intentionally never tracked are not backfilled.
    • Backfill (node .github/scripts/update-releases.mjs 1.3.2 1.3.3): adds the specific versions, useful for catching up if a scheduled run was missed. Wired through the workflow_dispatch version input.

The script downloads the upstream oras_<version>_checksums.txt, parses the lines, and writes entries that match the existing schema ({platform: {arch: {checksum, url}}}). Missing/404 checksum files cause a non-zero exit before any write, so a partial file is never persisted. Auto runs that find nothing exit silently.

The PR opened by the workflow is created with GITHUB_TOKEN, which means follow-up CI (Tests, Check dist/) will not auto-trigger on it — a maintainer needs to push an empty commit or close/reopen to kick CI. If that friction becomes a pain we can swap to a PAT or GitHub App token in a follow-up.

Closes #168. Refs #166, #167.

Test plan

  • node .github/scripts/update-releases.mjs — no-op when current max (1.3.2) matches upstream
  • node .github/scripts/update-releases.mjs 1.3.2 — no-op for already-present version
  • node .github/scripts/update-releases.mjs 0.16.0 — successfully fetches checksums and inserts entry in semver order (then reverted locally)
  • npm run build — passes, no dist drift
  • YAML parses cleanly (js-yaml)
  • After merge, manually trigger the workflow with no input to confirm scheduled path
  • After merge, manually trigger with version: 1.3.0 (already present) to confirm graceful skip

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TerryHowe TerryHowe closed this May 25, 2026
@TerryHowe TerryHowe reopened this May 25, 2026
Adds .github/workflows/update-releases.yml that runs daily (and on
workflow_dispatch) to detect new oras-project/oras releases and open a
PR appending them to src/lib/data/releases.json with rebuilt dist/.

The companion script .github/scripts/update-releases.mjs handles
discovery and checksum parsing. It supports two modes:

- No args: auto-detect via the GitHub releases API, only adding
  versions strictly newer than the current max in releases.json.
- Explicit version args: backfill specific versions (useful when a
  release was missed).

Closes #168.

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
@TerryHowe TerryHowe force-pushed the feat/168-automate-releases-update branch from bdaf65b to 9960d38 Compare May 25, 2026 11:23
@TerryHowe TerryHowe merged commit 930087d into main May 25, 2026
12 checks passed
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.

feat: automate releases.json updates via GitHub Actions workflow

2 participants