Skip to content

Commit fb369b0

Browse files
Fix script not found error by returning to source branch after push
The workflow was failing with "No such file or directory" when trying to run check_screenshot_changes.sh because: - update_screenshot_branch.sh switches to the pr-screenshot orphan branch - After pushing, it didn't return to the original branch - The next workflow step tries to run check_screenshot_changes.sh - But that script doesn't exist on pr-screenshot branch (only on PR branch) Fixed by adding code at the end of update_screenshot_branch.sh to checkout the source branch after pushing. This ensures subsequent workflow steps can access scripts from the PR branch. Now the workflow will: 1. Generate screenshots on PR branch 2. Switch to pr-screenshot branch and push screenshots 3. Return to PR branch 4. Run check_screenshot_changes.sh (script now available) 5. Comment on PR with changed screenshots Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
1 parent 5be0a71 commit fb369b0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/update_screenshot_branch.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ git add "$PR_FOLDER"/*.png
9999

100100
if git diff --staged --quiet; then
101101
echo "No screenshot changes to commit"
102-
exit 0
103102
else
104103
echo "Committing screenshot changes..."
105104
git commit -m "Update screenshots for PR #$PR_NUMBER [skip ci]"
@@ -109,3 +108,7 @@ else
109108

110109
echo "✓ Screenshots updated successfully to $BRANCH_NAME/$PR_FOLDER"
111110
fi
111+
112+
# Return to the original branch
113+
echo "Returning to source branch: $SOURCE_BRANCH..."
114+
git checkout "$SOURCE_BRANCH"

0 commit comments

Comments
 (0)