From 77dd966eb18ab5c381f119b06c54fed558c6c25b Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 2 Jun 2023 12:12:32 +0100 Subject: [PATCH] .github/workflows/preview.yml: Fix preview workflow --- .github/workflows/preview.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 50849edd3..c080ad051 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -63,6 +63,7 @@ jobs: # anyway. repository: ARM-software/lisa path: origin-repo + ref: master - uses: actions/setup-python@v4 with: @@ -70,6 +71,8 @@ jobs: - name: Setup git run: | + cd origin-repo && + git config --global user.name 'GitHub Action' git config --global user.email 'GitHub Action' @@ -87,18 +90,19 @@ jobs: lisa-combine-pr --repo 'ARM-Software/lisa' --pr-label preview --branch preview-force && + git fetch origin preview && + # Work in a separate worktree so that there is no risk of folders # added to PATH by init_env being manipulated git worktree add --checkout preview ../preview-repo && - cd ../preview-repo && - git diff --binary HEAD..preview-force > update.patch && + git -C ../preview-repo diff --binary HEAD..preview-force > update.patch && if [[ -s update.patch ]]; then # Apply the patch to the index as well, so that any file created # is automatically added to the commit we are about to create. - git apply --index update.patch && - git commit --all -m "Autocommit to preview branch on $(date) tracking preview-force" + git -C ../preview-repo apply --index update.patch && + git -C ../preview-repo commit --all -m "Autocommit to preview branch on $(date) tracking preview-force" git push --force origin preview-force git push origin preview -- GitLab