Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,32 @@ runs:
repository: ${{ inputs.destination-repository }}
commit_message: ${{ steps.prepare.outputs.commit-message }}
branch: ${{ inputs.destination-branch }}
continue-on-error: true
- name: fallback to git command for large assets
if: failure()
run: |
set -euo pipefail
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}"@users.noreply.github.com
repo="https://$GITHUB_ACTOR:$GITHUB_TOKEN@$github.com/${DESTINATION_REPOSITORY}.git"
git add .
git diff-index --quiet HEAD || git commit --message "$COMMIT_MESSAGE"
git push $repo --set-upstream "$DESTINATION_BRANCH"
env:
GITHUB_ACTOR: ${{ github.actor }}
COMMIT_MESSAGE: ${{ steps.prepare.outputs.commit-message }}
DESTINATION_BRANCH: ${{ inputs.destination-branch }}
DESTINATION_REPOSITORY: ${{ inputs.destination-repository }}
continue-on-error: true
shell: bash
- name: restore stashed original workspace from worktree
run: |
TEMP_DIR="$(mktemp -d)/$WORKTREE_DIR"
mv ./$WORKTREE_DIR "$TEMP_DIR"
rm -rf "$GITHUB_WORKSPACE"
mv "$TEMP_DIR" "$GITHUB_WORKSPACE"
shell: bash
if: always()
env:
WORKTREE_DIR: .push-to-another-repository
branding:
Expand Down