Add the submit action #2

Merged
jeff merged 1 commit from submit-action into main 2026-10-14 01:29:16 -05:00
Owner

Closes #1.

Adds a composite action (action.yml) that runs winget_submit.py from this repository's flake, like niks3-push does. Steps:

  1. Clone jeff/winget-pkgs at main, a shallow clone.
  2. Run nix develop -c python3 -m wingetsource new-version --json ... in that clone.
  3. Commit as the token's user, taking the name and email from GET /user.
  4. Run wingetsource check --changed-since origin/main. It runs on the commit because check finds changed versions by diffing.
  5. Force-push submit/<identifier>/<version>.
  6. Open a pull request titled <identifier> <version>, unless one is already open from that branch in jeff/winget-pkgs.

The body links the release (the release-notes-url, or else the tag's release page), the workflow run, and the version it was copied from.

  • Inputs: identifier, version, installers (one <architecture> <url> per line), release-notes-url, release-date, token, dry-run. The forge and jeff/winget-pkgs are built in.
  • Token handling: git receives the token as an http.<forge>/.extraHeader setting through GIT_CONFIG_* environment variables. It never appears in the process list or in the clone's config.
  • Dry run: does everything except push, prints the commit and the pull request body, and needs no token.
  • Tests and CI: 18 unit tests cover input parsing, naming, the body, the git authentication environment, and finding the open pull request. The workflow now also runs the tests and nix build .#submit.
  • Cleanup: REUSE.toml loses three annotations copied from winget-pkgs for paths that don't exist here.

Depends on jeff/winget-pkgs#10

The copied-from version comes from new-version --json, which is jeff/winget-pkgs#10. Until that merges, the action fails at the new-version step.

Tested

I ran a dry run against the real jeff/winget-pkgs, with the script pointed at #10's branch instead of main for that run only. It wrote Clipwatch 0.2.1 from 0.2.0. check downloaded the installer from git.jcollie.dev and reported 0 problems, and the body came out as expected. The installer was Clipwatch's source archive, because Clipwatch has no Windows asset on git.jcollie.dev yet. Pushing and opening a pull request haven't been exercised; that needs WINGET_BOT_TOKEN (jeff/winget-pkgs#8).

🤖 Generated with Claude Code

https://claude.ai/code/session_01D31MsLkM9DkCauP1EB2zgw

Closes #1. Adds a composite action (`action.yml`) that runs `winget_submit.py` from this repository's flake, like `niks3-push` does. Steps: 1. Clone `jeff/winget-pkgs` at `main`, a shallow clone. 2. Run `nix develop -c python3 -m wingetsource new-version --json ...` in that clone. 3. Commit as the token's user, taking the name and email from `GET /user`. 4. Run `wingetsource check --changed-since origin/main`. It runs on the commit because `check` finds changed versions by diffing. 5. Force-push `submit/<identifier>/<version>`. 6. Open a pull request titled `<identifier> <version>`, unless one is already open from that branch in `jeff/winget-pkgs`. The body links the release (the `release-notes-url`, or else the tag's release page), the workflow run, and the version it was copied from. - **Inputs:** `identifier`, `version`, `installers` (one `<architecture> <url>` per line), `release-notes-url`, `release-date`, `token`, `dry-run`. The forge and `jeff/winget-pkgs` are built in. - **Token handling:** git receives the token as an `http.<forge>/.extraHeader` setting through `GIT_CONFIG_*` environment variables. It never appears in the process list or in the clone's config. - **Dry run:** does everything except push, prints the commit and the pull request body, and needs no token. - **Tests and CI:** 18 unit tests cover input parsing, naming, the body, the git authentication environment, and finding the open pull request. The workflow now also runs the tests and `nix build .#submit`. - **Cleanup:** `REUSE.toml` loses three annotations copied from `winget-pkgs` for paths that don't exist here. ## Depends on jeff/winget-pkgs#10 The copied-from version comes from `new-version --json`, which is jeff/winget-pkgs#10. Until that merges, the action fails at the `new-version` step. ## Tested I ran a dry run against the real `jeff/winget-pkgs`, with the script pointed at #10's branch instead of `main` for that run only. It wrote Clipwatch 0.2.1 from 0.2.0. `check` downloaded the installer from git.jcollie.dev and reported 0 problems, and the body came out as expected. The installer was Clipwatch's source archive, because Clipwatch has no Windows asset on git.jcollie.dev yet. Pushing and opening a pull request haven't been exercised; that needs `WINGET_BOT_TOKEN` (jeff/winget-pkgs#8). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01D31MsLkM9DkCauP1EB2zgw
add the submit action
All checks were successful
test / test (push) Successful in 1m45s
fcb4815a8a
A composite action that clones jeff/winget-pkgs at main, has its
`wingetsource new-version` write the new version and `check` judge it,
then force-pushes `submit/<identifier>/<version>` and opens a pull
request as the submitter, or leaves the one already open. A dry run
does everything but push and needs no token. The token reaches git as
an HTTP header through the environment, never the command line.

Also drops REUSE.toml annotations for paths that only exist in
jeff/winget-pkgs.

Closes #1

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D31MsLkM9DkCauP1EB2zgw
jeff merged commit 6971838e70 into main 2026-10-14 01:29:16 -05:00
jeff deleted branch submit-action 2026-10-14 01:29:21 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jeff/winget-submit!2
No description provided.