diff --git a/.github/workflows/e2e-action-commit-push.yml b/.github/workflows/e2e-action-commit-push.yml index f17bba3..127e68d 100644 --- a/.github/workflows/e2e-action-commit-push.yml +++ b/.github/workflows/e2e-action-commit-push.yml @@ -311,12 +311,6 @@ jobs: needs: [preflight] runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - fetch-depth: 0 - path: repo - - name: Checkout action source for ref-mode validation if: ${{ inputs.mode == 'ref' }} uses: actions/checkout@v6 @@ -325,20 +319,56 @@ jobs: ref: ${{ inputs.action_ref }} path: action-src - - name: Create test file - run: echo "E2E identity override test $(date -u)" > repo/e2e-identity-override.md + - name: Prepare local repository + if: ${{ inputs.mode == 'ref' }} + run: | + set -euo pipefail + rm -rf "${RUNNER_TEMP}/identity-ws" "${RUNNER_TEMP}/identity-remote.git" "${RUNNER_TEMP}/identity-output.txt" "${RUNNER_TEMP}/identity-bin" + mkdir -p "${RUNNER_TEMP}/identity-ws" "${RUNNER_TEMP}/identity-bin" + git init "${RUNNER_TEMP}/identity-ws" + git -C "${RUNNER_TEMP}/identity-ws" branch -m master + git -C "${RUNNER_TEMP}/identity-ws" config user.name init + git -C "${RUNNER_TEMP}/identity-ws" config user.email init@example.com + touch "${RUNNER_TEMP}/identity-ws/.keep" + git -C "${RUNNER_TEMP}/identity-ws" add . + git -C "${RUNNER_TEMP}/identity-ws" commit -m init + git init --bare "${RUNNER_TEMP}/identity-remote.git" + git -C "${RUNNER_TEMP}/identity-ws" remote add origin "${RUNNER_TEMP}/identity-remote.git" + echo "E2E identity override test $(date -u)" > "${RUNNER_TEMP}/identity-ws/e2e-identity-override.md" + real_git="$(command -v git)" + cat > "${RUNNER_TEMP}/identity-bin/git" </dev/null 2>&1; then - git push origin --delete "${branch}" - fi - reset-target-branch-to-base: name: Reset target branch to base branch needs: [preflight]