From dcd0c3eadb6189051ba0efe0a1f251a995fe8895 Mon Sep 17 00:00:00 2001 From: Nathan Wasson Date: Thu, 16 Jan 2025 16:59:28 -0600 Subject: [PATCH] Update format.yml to us GITHUB_TOKEN & GitHub Actions bot (#2044) --- .github/workflows/format.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 2ed014d04..7a75ad203 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -11,15 +11,9 @@ env: jobs: format-code: runs-on: ubuntu-latest + permissions: + contents: write steps: - - name: Retrieve secrets from Keeper - id: ksecrets - uses: Keeper-Security/ksm-action@master - with: - keeper-secret-config: ${{ secrets.KSM_CONFIG }} - secrets: |- - v2h4jKiZlJywDSoKzRMnRw/field/Access Token > env:PAT # Fetch PAT and store in environment variable - - name: Checkout code uses: actions/checkout@v4 with: @@ -58,15 +52,13 @@ jobs: done - name: Commit and push changes - env: - PAT: ${{ env.PAT }} # Use PAT fetched from Keeper run: | HAS_CHANGES=$(git diff --staged --name-only) if [ ${#HAS_CHANGES} -gt 0 ]; then - git config --global user.name mlcommons-bot - git config --global user.email "mlcommons-bot@users.noreply.github.com" + git config --global user.name github-actions[bot] + git config --global user.email "github-actions[bot]@users.noreply.github.com" # Commit changes git commit -m '[Automated Commit] Format Codebase' - # Use the PAT to push changes - git push https://x-access-token:${PAT}@github.com/${{ github.repository }} HEAD:${{ github.ref_name }} + # Use the GITHUB_TOKEN to push changes + git push fi