Repository navigation
feat: add push retry and commit SHA outputs (STS-2383) - #3
Merged
whyvez merged 6 commits intoNov 19, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
oycyc
previously approved these changes
Nov 19, 2026
whyvez
marked this pull request as ready for review
November 19, 2026 14:49
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
oycyc
approved these changes
Nov 19, 2026
whyvez
deleted the
feature/STS-2383/add-push-retry-and-commit-sha-outputs
branch
November 19, 2026 15:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
The action now retries its push when another run updated the target branch first, so concurrent updates no longer get lost. It also passes inputs to the shell safely and outputs the pushed commit SHA and its parent.
What and why
! [rejected] main -> main (fetch first)) and that update was lost. Each attempt now fetches the latesttarget_branch, re-applies the YAML edit, commits and pushes, up tomax_attempts(new input, default5) with a short random delay. Re-applying the edit instead of rebasing means no conflict handling is needed.${{ inputs.* }}was interpolated straight into the bash script, so a"or$(...)incommit_messageornew_valuebroke the step or ran as code. All inputs now go throughenv:and the value is set with yqstrenv().sha(pushed commit) andbase_sha(its parent) outputs, so callers can act on the exact commit, e.g. sts-devops starting Spacelift runs pinned to that SHA.ci(gitops):prefix,--allow-empty, and the yq/diff/patch blank-line workaround are unchanged. Planned as a minor release (v0.2.0)..github/workflows/test.yaml): creates a scratch branch, runs two updates against it concurrently with acommit_messagecontaining"and$(echo pwned), checks both commits land with the message stored literally, checkssha/base_sha, then deletes the branch..trunk/(actionlint, shellcheck, shfmt, gitleaks, yamllint, markdownlint, prettier, checkov, trufflehog) and.github/workflows/lint.yaml, which runs Trunk as a job namedlint. The repo's Default ruleset already required alintcheck, but no workflow produced one, so PRs were blocked from merging.diff -Bonly ignores all-blank hunks). Documented in the README.Testing
Simulated locally with two concurrent runs against a bare repo: one push was rejected and succeeded on retry, both commits landed,
sha/base_shamatched, and the"/$(echo pwned)message and value were stored literally.Still to check on this PR:
testworkflow green (bothupdatematrix jobs,verify,cleanup)Push rejected (attempt 1/5)(the race is not guaranteed every run; re-run withgh workflow run test.yaml --ref feature/STS-2383/add-push-retry-and-commit-sha-outputs)trunk check --allAfter merge:
gh release create v0.2.0 --target main --generate-notes -R masterpointio/github-action-gitops-update.github/workflows/gitops-update.yamlback to the action pinned to thev0.2.0SHA (after SubaruTechShare/sts-devops#1640 merges)Rollback: re-pin callers to v0.1.0 (
805dda2cd0307bc19436cb8be6fc647159eadb58).Ticket
STS-2383
Links
Paired with Claude Code
🤖 Generated with Claude Code