Skip to content

Commit 8544d2a

Browse files
committed
feat: make check_branch as a step
1 parent 296acab commit 8544d2a

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

.github/workflows/sync-docs.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,19 @@ permissions:
1313
pull-requests: write
1414

1515
jobs:
16-
check-branch:
17-
name: Check if PR branch exists
16+
sync-docs:
17+
name: Sync Next.js Docs
1818
runs-on: ubuntu-latest
19-
outputs:
20-
should_sync: ${{ steps.check_branch.outputs.should_sync }}
2119
steps:
2220
- name: Check if PR branch exists
23-
id: check_branch
2421
run: |
2522
if git ls-remote --heads https://github.com/${{ github.repository }}.git | grep -q "docs/sync-nextjs-documentation"; then
26-
echo "Branch already exists, skipping update"
27-
echo "should_sync=false" >> $GITHUB_OUTPUT
23+
echo "::notice::Branch 'docs/sync-nextjs-documentation' already exists, skipping documentation sync"
24+
exit 1
2825
else
29-
echo "Branch does not exist, proceeding with update"
30-
echo "should_sync=true" >> $GITHUB_OUTPUT
26+
echo "::notice::Branch 'docs/sync-nextjs-documentation' does not exist, proceeding with documentation sync"
3127
fi
3228
33-
sync-docs:
34-
name: Sync Next.js Docs
35-
runs-on: ubuntu-latest
36-
needs: check-branch
37-
if: needs.check-branch.outputs.should_sync == 'true'
38-
steps:
3929
- name: Checkout repository
4030
uses: actions/checkout@v4
4131
with:

0 commit comments

Comments
 (0)