From 916a69ddaa3581386a95da88b77454f787880905 Mon Sep 17 00:00:00 2001 From: kosenda Date: Wed, 20 Mar 2024 18:20:48 +0900 Subject: [PATCH] fix: add Checkout companion branch --- .github/workflows/CommentScreenshotDiff.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CommentScreenshotDiff.yml b/.github/workflows/CommentScreenshotDiff.yml index 5bd7acb4..99edbb49 100644 --- a/.github/workflows/CommentScreenshotDiff.yml +++ b/.github/workflows/CommentScreenshotDiff.yml @@ -33,15 +33,16 @@ jobs: git fetch origin companion_${{ inputs.pr_branch_name }} && echo true || echo false ) >> $GITHUB_OUTPUT - if [is_exist == 'true']; then - echo "companion_branch_name=companion_${{ inputs.pr_branch_name }}" >> $GITHUB_OUTPUT - fi - - name: Checkout screenshots branch + - name: Save companion branch name + id: save-companion-branch-name + run: echo "name=companion_${{ inputs.pr_branch_name }}" >> $GITHUB_OUTPUT + + - name: Checkout companion branch if: steps.check-exist-companion.outputs.is_exist == 'true' uses: actions/checkout@v4 with: - ref: ${{ steps.check-exist-companion.outputs.companion_branch_name }} + ref: ${{ steps.save-companion-branch-name.outputs.name }} - name: Create comments if: steps.check-exist-companion.outputs.is_exist == 'true' @@ -59,7 +60,7 @@ jobs: for file in $files; do fileName=$(basename "$file" | sed -r 's/(.{20})/\1
/g') - echo "| [$fileName](https://github.com/${{ github.repository }}/blob/${{ steps.check-exist-companion.outputs.companion_branch_name }}/$file) | ![](https://github.com/${{ github.repository }}/blob/${{ steps.check-exist-companion.outputs.companion_branch_name }}/$file?raw=true) |" >> "$GITHUB_OUTPUT" + echo "| [$fileName](https://github.com/${{ github.repository }}/blob/${{ steps.save-companion-branch-name.outputs.name }}/$file) | ![](https://github.com/${{ github.repository }}/blob/${{ steps.save-companion-branch-name.outputs.name }}/$file?raw=true) |" >> "$GITHUB_OUTPUT" done echo "${delimiter}" >> "$GITHUB_OUTPUT"