|
9 | 9 | jobs: |
10 | 10 | main: |
11 | 11 | if: github.repository == 'grafana/pyroscope' |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + id-token: write |
12 | 15 | runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-small' || 'ubuntu-latest' }} |
13 | 16 | steps: |
14 | 17 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
15 | 18 | with: |
16 | | - persist-credentials: false |
| 19 | + persist-credentials: 'false' |
| 20 | + - id: get-secrets |
| 21 | + uses: grafana/shared-workflows/actions/get-vault-secrets@50003525a2bfea2f21a7dcec5fc67ab22690d19d |
| 22 | + with: |
| 23 | + repo_secrets: | |
| 24 | + GITHUB_APP_ID=pyroscope-development-app:app-id |
| 25 | + GITHUB_APP_INSTALLATION_ID=pyroscope-development-app:app-installation-id |
| 26 | + GITHUB_APP_PRIVATE_KEY=pyroscope-development-app:private-key |
| 27 | + - name: Generate token |
| 28 | + id: generate_token |
| 29 | + uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 |
| 30 | + with: |
| 31 | + app-id: ${{ env.GITHUB_APP_ID }} |
| 32 | + private-key: ${{ env.GITHUB_APP_PRIVATE_KEY }} |
| 33 | + owner: ${{ github.repository_owner }} |
| 34 | + permission-contents: write |
| 35 | + permission-pull-requests: write |
| 36 | + repositories: | |
| 37 | + pyroscope |
| 38 | + - name: Get GitHub App User ID |
| 39 | + id: get-user-id |
| 40 | + env: |
| 41 | + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} |
| 42 | + run: | |
| 43 | + APP_BOT="${{ steps.generate_token.outputs.app-slug }}[bot]" |
| 44 | + echo "user-id=$(gh api "/users/${APP_BOT}" --jq .id)" >> "$GITHUB_OUTPUT" |
| 45 | + - name: Configure git remote |
| 46 | + run: | |
| 47 | + APP_BOT="${{ steps.generate_token.outputs.app-slug }}[bot]" |
| 48 | + git config --local user.name "${APP_BOT}" |
| 49 | + git config --local user.email "${{ steps.get-user-id.outputs.user-id }}+${APP_BOT}@users.noreply.github.com" |
| 50 | + git remote set-url "origin" https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}.git > /dev/null 2> /dev/null |
17 | 51 | - uses: grafana/writers-toolkit/update-make-docs@d87843b53c21125598f5e20e5bebae213f0059b6 |
18 | 52 | with: |
19 | 53 | pr_options: > |
20 | 54 | --label type/docs |
| 55 | + token: ${{ steps.generate_token.outputs.token }} |
21 | 56 | trace: true |
0 commit comments