Skip to content

Commit 9721372

Browse files
author
Darius Neațu
committed
Move debug section earlier in workflow (after branch name generation)
1 parent ee01cd9 commit 9721372

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

.github/workflows/sync-docs.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,6 @@ jobs:
5555
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
5656
echo "Generated branch name: $BRANCH_NAME"
5757
58-
- name: Show changes
59-
run: |
60-
echo "=== Changes detected ==="
61-
git status
62-
echo ""
63-
echo "=== Diff ==="
64-
git diff || echo "No changes detected"
65-
66-
- name: Check if PAT is available for PR creation
67-
id: check-pat
68-
run: |
69-
if [ -n "${{ secrets.GH_PAT }}" ]; then
70-
echo "pat_available=true" >> $GITHUB_OUTPUT
71-
echo "✅ GH_PAT secret is available - will use it for PR creation"
72-
else
73-
echo "pat_available=false" >> $GITHUB_OUTPUT
74-
if [ "${{ github.event_name }}" == "pull_request" ]; then
75-
echo "❌ FATAL: GH_PAT secret is required when running on pull_request events"
76-
echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions"
77-
exit 1
78-
else
79-
echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN"
80-
fi
81-
fi
82-
8358
- name: Debug workflow context and permissions
8459
run: |
8560
echo "=== Workflow Debug Information ==="
@@ -120,6 +95,31 @@ jobs:
12095
echo ""
12196
echo "=== End Debug Information ==="
12297
98+
- name: Show changes
99+
run: |
100+
echo "=== Changes detected ==="
101+
git status
102+
echo ""
103+
echo "=== Diff ==="
104+
git diff || echo "No changes detected"
105+
106+
- name: Check if PAT is available for PR creation
107+
id: check-pat
108+
run: |
109+
if [ -n "${{ secrets.GH_PAT }}" ]; then
110+
echo "pat_available=true" >> $GITHUB_OUTPUT
111+
echo "✅ GH_PAT secret is available - will use it for PR creation"
112+
else
113+
echo "pat_available=false" >> $GITHUB_OUTPUT
114+
if [ "${{ github.event_name }}" == "pull_request" ]; then
115+
echo "❌ FATAL: GH_PAT secret is required when running on pull_request events"
116+
echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions"
117+
exit 1
118+
else
119+
echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN"
120+
fi
121+
fi
122+
123123
- name: Create Pull Request
124124
if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true'
125125
uses: peter-evans/create-pull-request@v6

0 commit comments

Comments
 (0)