From 8a8679fc4eaedf45c662ffa88ea277270cb72ed9 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 18:55:44 +0300 Subject: [PATCH] [v11.1.x] CI: fix changelog repo null (#90966) CI: fix changelog repo null (#90960) * give secrets when running changelog action * i guess secrets don't have types (cherry picked from commit d4304b59ec78f3736a193cc7ab5dfe7a56b4902f) Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> --- .github/workflows/changelog.yml | 14 +++++++++++++- .github/workflows/release-pr.yml | 11 ++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 6a012b83634..a160595cef1 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -18,6 +18,12 @@ on: required: false default: false type: boolean + secrets: + GRAFANA_DELIVERY_BOT_APP_ID: + required: true + GRAFANA_DELIVERY_BOT_APP_PEM: + required: true + workflow_dispatch: inputs: version: @@ -47,6 +53,12 @@ jobs: permissions: contents: write steps: + - name: "Generate token" + id: generate_token + uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 + with: + app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }} + private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }} - name: "Checkout Grafana repo" uses: "actions/checkout@v4" with: @@ -66,7 +78,7 @@ jobs: id: changelog uses: ./.github/workflows/actions/changelog with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ steps.generate_token.outputs.token }} target: v${{ inputs.version }} output_file: changelog_items.md - name: "Patch CHANGELOG.md" diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 68d89c452ba..13e696b55df 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -42,11 +42,20 @@ jobs: latest: ${{ inputs.latest }} dry_run: ${{ inputs.dry_run }} target: main + secrets: + GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }} + GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }} create-prs: name: Create Release PR runs-on: ubuntu-latest if: github.repository == 'grafana/grafana' steps: + - name: Generate bot token + id: generate_token + uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 + with: + app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }} + private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }} - name: Checkout Grafana uses: actions/checkout@v4 with: @@ -66,7 +75,7 @@ jobs: id: changelog uses: ./.github/workflows/actions/changelog with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ steps.generate_token.outputs.token }} target: v${{ inputs.version }} output_file: changelog_items.md