Browse Source

fix: enhancing security for new workflow (#4641)

Signed-off-by: Gustavo Carvalho <gustavo@externalsecrets.com>
Gustavo Fernandes de Carvalho 1 year ago
parent
commit
ab0153cfb3
1 changed files with 4 additions and 2 deletions
  1. 4 2
      .github/workflows/dependabot-approve.yml

+ 4 - 2
.github/workflows/dependabot-approve.yml

@@ -1,5 +1,7 @@
 name: Dependabot Pull Request Approve and Merge
 name: Dependabot Pull Request Approve and Merge
 on: pull_request_target
 on: pull_request_target
+permissions:
+  contents: read
 jobs:
 jobs:
   dependabot:
   dependabot:
     permissions:
     permissions:
@@ -10,7 +12,7 @@ jobs:
     # PRs but also ensures that it only does work for Dependabot PRs.
     # PRs but also ensures that it only does work for Dependabot PRs.
     if: ${{ github.actor == 'dependabot[bot]' }}
     if: ${{ github.actor == 'dependabot[bot]' }}
     steps:
     steps:
-      - uses: actions/create-github-app-token@v1
+      - uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
         id: app-token
         id: app-token
         with:
         with:
           app-id: ${{ secrets.APP_ID }}
           app-id: ${{ secrets.APP_ID }}
@@ -19,7 +21,7 @@ jobs:
       # will not occur.
       # will not occur.
       - name: Dependabot metadata
       - name: Dependabot metadata
         id: dependabot-metadata
         id: dependabot-metadata
-        uses: dependabot/fetch-metadata@v1.1.1
+        uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
         with:
         with:
           github-token: "${{ steps.app-token.outputs.token }}"
           github-token: "${{ steps.app-token.outputs.token }}"
       # Here the PR gets approved.
       # Here the PR gets approved.