b1ddad2c99
* feat: update author and committer input defaults * Update github-actions[bot] * Update author to new email format * feat: optional input for git ops token * feat: allow push-to-fork to push to sibling repos (#2414) Fixes #2412. * build: update dist * feat: update action runtime to node 20 (#2340) * feat: add truncate warning to pull request body * perf: unshallow only when necessary * fix: remove the remote for the fork on completion * feat: infer github server and api urls * test: integration test fixes * build: bump major version * docs: update to v6 --------- Co-authored-by: Teko <112829523+Teko012@users.noreply.github.com> Co-authored-by: Benjamin Gilbert <bgilbert@backtick.net>
41 lines
1.1 KiB
Bash
Executable file
41 lines
1.1 KiB
Bash
Executable file
#!/bin/sh -l
|
|
set -euo pipefail
|
|
|
|
# Save the working directory
|
|
WORKINGDIR=$PWD
|
|
|
|
# Create and serve a remote repo
|
|
mkdir -p /git/remote/repos
|
|
git config --global init.defaultBranch main
|
|
git init --bare /git/remote/repos/test-base.git
|
|
git daemon --verbose --enable=receive-pack --base-path=/git/remote --export-all /git/remote &>/dev/null &
|
|
|
|
# Give the daemon time to start
|
|
sleep 2
|
|
|
|
# Create a local clone and make an initial commit
|
|
mkdir -p /git/local/repos
|
|
git clone git://127.0.0.1/repos/test-base.git /git/local/repos/test-base
|
|
cd /git/local/repos/test-base
|
|
git config --global user.email "you@example.com"
|
|
git config --global user.name "Your Name"
|
|
echo "#test-base" > README.md
|
|
git add .
|
|
git commit -m "initial commit"
|
|
git push -u
|
|
git log -1 --pretty=oneline
|
|
git config --global --unset user.email
|
|
git config --global --unset user.name
|
|
git config -l
|
|
|
|
# Clone a server-side fork of the base repo
|
|
cd $WORKINGDIR
|
|
git clone --mirror git://127.0.0.1/repos/test-base.git /git/remote/repos/test-fork.git
|
|
cd /git/remote/repos/test-fork.git
|
|
git log -1 --pretty=oneline
|
|
|
|
# Restore the working directory
|
|
cd $WORKINGDIR
|
|
|
|
# Execute integration tests
|
|
jest int --runInBand
|