From f7fe8b7f7ebe48a5c11194a7967cd58b9147fbe9 Mon Sep 17 00:00:00 2001 From: Jev Forsberg <46619047+baldm0mma@users.noreply.github.com> Date: Tue, 29 Apr 2025 18:26:54 -0600 Subject: [PATCH] Chore: Use Vault secrets in `pr-patch-check-event.yml` (#104725) * baldm0mma/ update to use vault * Update .github/workflows/pr-patch-check-event.yml Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * Update .github/workflows/pr-patch-check-event.yml Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> --------- Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> --- .github/workflows/pr-patch-check-event.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-patch-check-event.yml b/.github/workflows/pr-patch-check-event.yml index f7605f033ce..d16e6580c51 100644 --- a/.github/workflows/pr-patch-check-event.yml +++ b/.github/workflows/pr-patch-check-event.yml @@ -13,7 +13,9 @@ on: - "v*.*.*" - "release-*" -permissions: {} +permissions: + contents: read + id-token: write # Since this is run on a pull request, we want to apply the patches intended for the # target branch onto the source branch, to verify compatibility before merging. @@ -31,13 +33,20 @@ jobs: PR_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} runs-on: ubuntu-latest steps: + - name: "Get vault secrets" + id: vault-secrets + uses: grafana/shared-workflows/actions/get-vault-secrets@main + with: + # Secrets placed in the ci/data/repo/grafana/grafana/delivery-bot-app path in Vault + repo_secrets: | + GRAFANA_DELIVERY_BOT_APP_PEM=delivery-bot-app:PRIVATE_KEY - name: "Generate token" id: generate_token uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a with: # App needs Actions: Read/Write for the grafana/security-patch-actions repo - app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }} - private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }} + app_id: ${{ vars.DELIVERY_BOT_APP_ID }} + private_key: ${{ env.GRAFANA_DELIVERY_BOT_APP_PEM }} - name: "Dispatch job" uses: actions/github-script@v7 with: