File tree Expand file tree Collapse file tree
.github/actions/gh-cache/save Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,17 +94,12 @@ runs:
9494 git config user.email "github-actions[bot]@users.noreply.github.com"
9595 git commit -m "$(printf 'Save artifact: %s' "${{ inputs.path }}")" \
9696 && echo "Committed '${{ inputs.path }}' to 'gh-cache' branch" \
97- || { echo "No changes to commit"; exit 0; }
98- # Push with retry to handle concurrent updates to gh-cache
99- for attempt in 1 2 3; do
100- if git push origin gh-cache 2>/dev/null; then
101- echo "Pushed to 'gh-cache' branch"
102- break
103- fi
104- echo "Push failed (attempt $attempt), rebasing and retrying..."
97+ || echo "No changes to commit"
98+ if git ls-remote --exit-code --heads origin gh-cache >/dev/null; then
10599 git fetch origin gh-cache
106100 git rebase origin/gh-cache
107- done
101+ fi
102+ git push origin gh-cache
108103 else
109104 echo "'${{ inputs.path }}' does not exist"
110105 echo "Skipping commit and push"
You can’t perform that action at this time.
0 commit comments