From ce65b9c9d3a8f414fa85db70dbbb33440ff6dec4 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Wed, 1 Nov 2023 17:38:56 +0800 Subject: [PATCH] actions: bug fix for sync-helpz --- .github/workflows/sync-helpz.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-helpz.yml b/.github/workflows/sync-helpz.yml index 62ceaf0..a58281b 100644 --- a/.github/workflows/sync-helpz.yml +++ b/.github/workflows/sync-helpz.yml @@ -22,11 +22,13 @@ jobs: NEW_COMMIT: ${{ inputs.new_commit }} run: | transpiled_dir="help/_posts/mirrorz-help-ng-transpiled" + track_branch="transpiled" if [ -n "$NEW_COMMIT" ]; then git -C "$transpiled_dir" fetch origin "+$NEW_COMMIT:refs/remotes/origin/incoming" --depth=1 git -C "$transpiled_dir" checkout --force "$NEW_COMMIT" else - git submodule update --remote "$transpiled_dir" + git -C "$transpiled_dir" fetch origin "+refs/heads/${track_branch}:refs/remotes/origin/${track_branch}" --depth=1 + git -C "$transpiled_dir" checkout --force "origin/${track_branch}" NEW_COMMIT=$(git -C "$transpiled_dir" rev-parse HEAD) fi NEW_COMMIT_SHORT=$(echo "$NEW_COMMIT" | cut -c1-8)