Skip to content

Commit fcaf5bf

Browse files
authored
fix the permission in update-deps (#128)
1 parent af88dbe commit fcaf5bf

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/update-deps.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ on:
2626
jobs:
2727
update:
2828
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
31+
pull-requests: write
32+
issues: read
2933
steps:
3034
- name: Checkout repo
3135
uses: actions/checkout@v4
@@ -95,6 +99,7 @@ jobs:
9599
96100
- name: Create Pull Request
97101
if: steps.changes.outputs.HAS_CHANGES == 'true'
102+
id: create_pr
98103
uses: peter-evans/create-pull-request@v6
99104
with:
100105
token: ${{ secrets.GITHUB_TOKEN }}
@@ -135,11 +140,19 @@ jobs:
135140
- name: Summary
136141
run: |
137142
if [ "${{ steps.changes.outputs.HAS_CHANGES }}" == "true" ]; then
138-
echo "✅ Pull request created successfully!"
139-
echo "📋 Summary:"
140-
echo " - Version: ${{ steps.version.outputs.NEW_VERSION }}"
141-
echo " - Dependencies updated: ${{ inputs.update_dependencies }}"
142-
echo " - API generated: ${{ inputs.generate_api }}"
143+
if [ "${{ steps.create_pr.outputs.pull-request-number }}" != "" ]; then
144+
echo "✅ Pull request created successfully!"
145+
echo "🔗 PR URL: ${{ steps.create_pr.outputs.pull-request-url }}"
146+
echo "📋 Summary:"
147+
echo " - PR Number: #${{ steps.create_pr.outputs.pull-request-number }}"
148+
echo " - Version: ${{ steps.version.outputs.NEW_VERSION }}"
149+
echo " - Dependencies updated: ${{ inputs.update_dependencies }}"
150+
echo " - API generated: ${{ inputs.generate_api }}"
151+
else
152+
echo "❌ Failed to create pull request!"
153+
echo "Please check the workflow logs for more details."
154+
exit 1
155+
fi
143156
else
144157
echo "ℹ️ No changes were made, so no PR was created."
145158
fi

0 commit comments

Comments
 (0)