|
55 | 55 | echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT |
56 | 56 | echo "Generated branch name: $BRANCH_NAME" |
57 | 57 |
|
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 | | -
|
83 | 58 | - name: Debug workflow context and permissions |
84 | 59 | run: | |
85 | 60 | echo "=== Workflow Debug Information ===" |
@@ -120,6 +95,31 @@ jobs: |
120 | 95 | echo "" |
121 | 96 | echo "=== End Debug Information ===" |
122 | 97 |
|
| 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 | +
|
123 | 123 | - name: Create Pull Request |
124 | 124 | if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' |
125 | 125 | uses: peter-evans/create-pull-request@v6 |
|
0 commit comments