Test sync source retry again #2257
Sync Source to Host / sync-source (push) Successful in 21s
Sync Source to Host / sync-source (push) Successful in 21s
This commit is contained in:
@@ -9,8 +9,29 @@ on:
|
||||
jobs:
|
||||
sync-source:
|
||||
runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Run sync script
|
||||
# run: |
|
||||
# echo "Running /data/sync.sh"
|
||||
# /data/sync.sh
|
||||
|
||||
steps:
|
||||
- name: Run sync script
|
||||
- name: Sync repository
|
||||
run: |
|
||||
echo "Running /data/sync.sh"
|
||||
/data/sync.sh
|
||||
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||
REPO_NAME=$(basename "${GITHUB_REPOSITORY}")
|
||||
TARGET_DIR="/data/${REPO_NAME}"
|
||||
BRANCH="${GITHUB_REF_NAME}"
|
||||
|
||||
if [ ! -d "$TARGET_DIR/.git" ]; then
|
||||
echo "Cloning repository..."
|
||||
git clone -b "$BRANCH" "$REPO_URL" "$TARGET_DIR"
|
||||
else
|
||||
echo "Updating repository..."
|
||||
git -C "$TARGET_DIR" fetch origin "$BRANCH"
|
||||
git -C "$TARGET_DIR" checkout "$BRANCH"
|
||||
git -C "$TARGET_DIR" reset --hard "origin/$BRANCH"
|
||||
fi
|
||||
|
||||
echo "Current commit:"
|
||||
git -C "$TARGET_DIR" log --oneline -1
|
||||
Reference in New Issue
Block a user