Skip to content

Commit 4702244

Browse files
committed
fix: 添加GitHub Actions写入权限以支持自动提交pack文件
1 parent 08f2c01 commit 4702244

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/cmake-single-platform.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ jobs:
1111
pack:
1212
name: Generate pack
1313
runs-on: ubuntu-22.04
14+
permissions:
15+
contents: write
1416
steps:
1517
- uses: actions/checkout@v3
1618
with:
1719
fetch-depth: 0
20+
token: ${{ secrets.GITHUB_TOKEN }}
1821

1922
- name: Fetch tags
2023
if: ${{ github.event_name == 'release' }}
@@ -50,5 +53,7 @@ jobs:
5053
git config user.name "github-actions[bot]"
5154
git config user.email "github-actions[bot]@users.noreply.github.com"
5255
git add cmsis-pack/*.pack
53-
git diff --staged --quiet || git commit -m "chore: Update CMSIS pack files [skip ci]"
54-
git push
56+
if ! git diff --staged --quiet; then
57+
git commit -m "chore: Update CMSIS pack files [skip ci]"
58+
git push origin HEAD:develop
59+
fi

0 commit comments

Comments
 (0)