Skip to content

Commit 5276079

Browse files
Workflow security update as suggested by @bboilot-ledger and copilot
(cherry picked from commit 975774c)
1 parent ee730f6 commit 5276079

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/build_clangrt_builtins.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Build clang runtime builtins
2+
permissions:
3+
contents: read
24

35
on:
46
workflow_dispatch:
@@ -67,6 +69,9 @@ jobs:
6769
runs-on: ubuntu-latest
6870
if: ${{ success() && inputs.create_pr }}
6971
continue-on-error: true
72+
permissions:
73+
contents: write
74+
pull-requests: write
7075
steps:
7176
- name: Clone repository
7277
uses: actions/checkout@v4
@@ -84,11 +89,12 @@ jobs:
8489
- name: PR creation
8590
env:
8691
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
TARGET_BRANCH: ${{ inputs.target_sdk_branch }}
8793
run: |
88-
git config --global user.email ${{ env.GIT_USER_EMAIL }}
89-
git config --global user.name ${{ env.GIT_USER_NAME }}
90-
git switch --create ${{ env.UPDATE_BRANCH }}
94+
git config --global user.email "$GIT_USER_EMAIL"
95+
git config --global user.name "$GIT_USER_NAME"
96+
git switch --create "$UPDATE_BRANCH"
9197
git add -A .
9298
git commit -m 'Updating static SDK libraries'
93-
git push -u origin ${{ env.UPDATE_BRANCH }}
94-
gh pr create -B ${{ inputs.target_sdk_branch }} --title '[SDK_LIBS_UPDATE] Updating static SDK libraries' --body 'Created by Github workflow "${{ github.workflow }}", job "${{ github.job }}", run "${{ github.run_id }}".'
99+
git push -u origin "$UPDATE_BRANCH"
100+
gh pr create -B "$TARGET_BRANCH" --title '[SDK_LIBS_UPDATE] Updating static SDK libraries' --body 'Created by Github workflow "${{ github.workflow }}", job "${{ github.job }}", run "${{ github.run_id }}".'

0 commit comments

Comments
 (0)