|
19 | 19 | # Necessary to authenticate with Vault which happens in dockerhub-login |
20 | 20 | id-token: write |
21 | 21 | steps: |
22 | | - # Retrieve GitHub App credentials to get a token with org member read permissions. |
23 | | - # GITHUB_TOKEN doesn't have org-level permissions, so we use the mimir-github-bot GitHub App. |
24 | | - - name: Retrieve GitHub App Credentials from Vault |
25 | | - id: get-secrets |
26 | | - uses: grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760 # v1.1.0 |
27 | | - with: |
28 | | - repo_secrets: | |
29 | | - APP_ID=mimir-github-bot:app_id |
30 | | - PRIVATE_KEY=mimir-github-bot:private_key |
31 | | -
|
32 | | - - name: Generate GitHub App Token |
33 | | - id: app-token |
34 | | - uses: actions/create-github-app-token@v1 |
35 | | - with: |
36 | | - app-id: ${{ env.APP_ID }} |
37 | | - private-key: ${{ env.PRIVATE_KEY }} |
38 | | - owner: ${{ github.repository_owner }} |
39 | | - |
40 | 22 | - name: Checkout Repository |
41 | 23 | uses: actions/checkout@v4 |
42 | 24 | with: |
|
64 | 46 | echo "::error::This workflow only excecutes when mimir-build-image/Dockerfile has been modified" |
65 | 47 | exit 1 |
66 | 48 |
|
| 49 | + # Retrieve GitHub App credentials to get a token with org member read permissions. |
| 50 | + # GITHUB_TOKEN doesn't have org-level permissions, so we use the mimir-github-bot GitHub App. |
| 51 | + - name: Retrieve GitHub App Credentials from Vault |
| 52 | + id: get-secrets |
| 53 | + uses: grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760 # v1.1.0 |
| 54 | + with: |
| 55 | + repo_secrets: | |
| 56 | + APP_ID=mimir-github-bot:app_id |
| 57 | + PRIVATE_KEY=mimir-github-bot:private_key |
| 58 | +
|
| 59 | + - name: Generate GitHub App Token |
| 60 | + id: app-token |
| 61 | + uses: actions/create-github-app-token@v1 |
| 62 | + with: |
| 63 | + app-id: ${{ env.APP_ID }} |
| 64 | + private-key: ${{ env.PRIVATE_KEY }} |
| 65 | + owner: ${{ github.repository_owner }} |
| 66 | + |
67 | 67 | # Check if PR author is a Grafana organization member using the GitHub API. |
68 | 68 | # This is more reliable than author_association which depends on public membership visibility. |
69 | 69 | # Uses the GitHub App token because GITHUB_TOKEN doesn't have org-level permissions. |
|
0 commit comments