Skip to content

v2.6.0 — Safe Receipts Edition

Choose a tag to compare

@Wolfe-Jam Wolfe-Jam released this 06 Nov 00:13
· 13 commits to main since this release
71de268

Receipts are never lost, and your checkout is never touched.

Fixed

  • No shell for the commit message (#39): the CLI ran git commit -m "<message>" through a shell, so --message 'x$(touch INJECTED)y' ran a command. Every git call now takes an argument list.
  • Receipt commits hold .taf only (#39, and the target-branch path in this release): git add and git commit name -- .taf, so whatever else is staged stays out of the receipt.
  • target-branch with a step working-directory: the first run committed the repository's other tracked files onto the receipts branch (the orphan init kept the whole index, and git rm -rf . only cleared the subfolder). The receipts branch now gets that .taf only. A receipts branch created this way by 2.5.0 or earlier keeps the files it already has: delete it, or remove them by hand.
  • The Action never writes git config (#39): it used git config --global user.name/user.email, which on a developer machine replaces their identity for every repo. The bot identity now goes to each git command as GIT_AUTHOR_* / GIT_COMMITTER_*.
  • A receipt write keeps the rest of the file: the file was rebuilt from parsed data, which dropped comments, blank lines and any later --- document. The receipts document is now edited as YAML (its comments and key order stay), and anything after it is kept byte for byte, even a document with a YAML error. As before, CRLF line ends become LF and history indentation becomes 2 spaces.
  • Runs that write the same .taf at once each keep their receipt: 20 parallel runs kept as few as 1–6 receipts, depending on the machine. Each write now holds .taf.lock (host:pid:token) and renames a temp file over .taf; 20 parallel runs keep 20. A lock left by a killed run (its process gone, or older than a minute) is taken over by one waiter at a time, so a live lock is never removed. A symlinked .taf stays a symlink and keeps its mode.
  • CLI --commit: a receipt that isn't pushed is an error. A rejected push exits 1 with git's reason (and the server's message), plus what to do: git pull --rebase && git push when the remote moved on, a check of push access and branch protection when the server refused. A branch with no upstream keeps the receipt in a local commit and says so.
  • target-branch found a branch that only ends in the same name (ls-remote matched archive/taf-receipts for taf-receipts) and then failed. It now asks for refs/heads/<branch>. A failing git command in the Action names git's own error.
  • target-branch no longer touches the job's checkout. The Action switched the checkout to the receipts branch, stashed changes it never restored, and on the first run emptied the working tree with git rm -rf .. On a developer machine that lost staged work. It now writes the receipt in a separate git worktree, in a temporary folder that is removed afterwards: the checkout keeps its branch, its staged work and its files.
  • --name=value works for every CLI option: --message=… was ignored and the default message used.

Added

  • Action output receipt-pushed: true when the receipt reached the remote; false with auto-commit: false, with no upstream (a pull request checkout), or when the push failed.
  • Action input fail-on-push-error (default false): fail the step when the receipt can't be pushed to the current branch.

Changed

  • A receipt that the Action can't push is no longer quiet. On target-branch, a push still rejected after 5 tries fails the step (it was a warning, and the receipt was lost). On the current branch it stays a warning, now saying the receipt is lost when the job ends and why (a read-only token, a protected branch, another run first), with receipt-pushed: false; set fail-on-push-error: true to fail the step instead. Many workflows push with a read-only GITHUB_TOKEN, so failing by default would turn them red.
  • After a target-branch run the job's checkout is still on its own branch. Before, later steps in the same job ran on the receipts branch.
  • During a merge, the CLI's --commit now fails (cannot do a partial commit during a merge) and leaves .taf staged. Before, it silently committed your merge as the receipt. Finish the merge, then commit the receipt.

Upgrade: uses: Wolfe-Jam/faf-taf-git@v2.6.0 · npm i -g faf-taf-git@2.6.0

If you used target-branch with a step working-directory on 2.5.0 or earlier: the receipts branch may hold your repo's other tracked files from its first run. 2.6.0 writes .taf only; delete the branch, or remove those files by hand.

Tests: 197/197.

FAF defines. AGENTS.md instructs. AI codes.