Skip to content

Commit dcd0c3e

Browse files
authored
Update format.yml to us GITHUB_TOKEN & GitHub Actions bot (#2044)
1 parent 277cf38 commit dcd0c3e

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

.github/workflows/format.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,9 @@ env:
1111
jobs:
1212
format-code:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
1416
steps:
15-
- name: Retrieve secrets from Keeper
16-
id: ksecrets
17-
uses: Keeper-Security/ksm-action@master
18-
with:
19-
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
20-
secrets: |-
21-
v2h4jKiZlJywDSoKzRMnRw/field/Access Token > env:PAT # Fetch PAT and store in environment variable
22-
2317
- name: Checkout code
2418
uses: actions/checkout@v4
2519
with:
@@ -58,15 +52,13 @@ jobs:
5852
done
5953
6054
- name: Commit and push changes
61-
env:
62-
PAT: ${{ env.PAT }} # Use PAT fetched from Keeper
6355
run: |
6456
HAS_CHANGES=$(git diff --staged --name-only)
6557
if [ ${#HAS_CHANGES} -gt 0 ]; then
66-
git config --global user.name mlcommons-bot
67-
git config --global user.email "mlcommons-[email protected]"
58+
git config --global user.name github-actions[bot]
59+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
6860
# Commit changes
6961
git commit -m '[Automated Commit] Format Codebase'
70-
# Use the PAT to push changes
71-
git push https://x-access-token:${PAT}@github.com/${{ github.repository }} HEAD:${{ github.ref_name }}
62+
# Use the GITHUB_TOKEN to push changes
63+
git push
7264
fi

0 commit comments

Comments
 (0)