[v9.4.x] GitHub Apps: Replace grafanabot token with grafana-delivery-bot GitHub App (#70457)
* GitHub Apps: Replace `grafanabot` token with `grafana-delivery-bot` GitHub App (#70242) * Update bump-version.yml * Fix secret * [REVERTME] Remove check * Test without grafana-delivery-bot prefix * Check if token exists * Cleanup bump-version * Update gh actions to use app key (cherry picked from commit15a85686c2) # Conflicts: # .github/workflows/backport.yml # .github/workflows/bump-version.yml # .github/workflows/milestone.yml # .github/workflows/update-changelog.yml * Bug: Fix `yaml` identation for github action yamls (#70445) * Fix yaml identation * Fix the rest of the yamls (cherry picked from commit31b9f9d235)
This commit is contained in:
@@ -17,10 +17,16 @@ jobs:
|
|||||||
ref: main
|
ref: main
|
||||||
- name: Install Actions
|
- name: Install Actions
|
||||||
run: npm install --production --prefix ./actions
|
run: npm install --production --prefix ./actions
|
||||||
|
- 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: Run backport
|
- name: Run backport
|
||||||
uses: ./actions/backport
|
uses: ./actions/backport
|
||||||
with:
|
with:
|
||||||
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
||||||
token: ${{secrets.GH_BOT_ACCESS_TOKEN}}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
labelsToAdd: "backport,no-changelog"
|
labelsToAdd: "backport,no-changelog"
|
||||||
title: "[{{base}}] {{originalTitle}}"
|
title: "[{{base}}] {{originalTitle}}"
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ on:
|
|||||||
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch or major.minor.patch-beta<number> format. example: 7.4.3 or 7.4.3-beta1'
|
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch or major.minor.patch-beta<number> format. example: 7.4.3 or 7.4.3-beta1'
|
||||||
required: true
|
required: true
|
||||||
env:
|
env:
|
||||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# This is a basic workflow to help you get started with Actions
|
# This is a basic workflow to help you get started with Actions
|
||||||
- uses: actions-ecosystem/action-regex-match@v2.0.2
|
- uses: actions-ecosystem/action-regex-match@v2.0.2
|
||||||
if: ${{ github.event.inputs.version != '' }}
|
if: ${{ github.event.inputs.version != '' }}
|
||||||
id: regex-match
|
id: regex-match
|
||||||
@@ -68,8 +68,14 @@ jobs:
|
|||||||
node-version: '16'
|
node-version: '16'
|
||||||
- name: Install Actions
|
- name: Install Actions
|
||||||
run: npm install --production --prefix ./actions
|
run: npm install --production --prefix ./actions
|
||||||
- name: Run bump version (manually invoked)
|
- 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: Run bump version (manually invoked)
|
||||||
uses: ./actions/bump-version
|
uses: ./actions/bump-version
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
||||||
|
|||||||
@@ -26,11 +26,17 @@ jobs:
|
|||||||
ref: main
|
ref: main
|
||||||
- name: Install Actions
|
- name: Install Actions
|
||||||
run: npm install --production --prefix ./actions
|
run: npm install --production --prefix ./actions
|
||||||
|
- 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: Close milestone (manually invoked)
|
- name: Close milestone (manually invoked)
|
||||||
if: ${{ github.event.inputs.version != '' }}
|
if: ${{ github.event.inputs.version != '' }}
|
||||||
uses: ./actions/close-milestone
|
uses: ./actions/close-milestone
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
- name: Close milestone (workflow invoked)
|
- name: Close milestone (workflow invoked)
|
||||||
if: ${{ inputs.version_call != '' }}
|
if: ${{ inputs.version_call != '' }}
|
||||||
uses: ./actions/close-milestone
|
uses: ./actions/close-milestone
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
required: true
|
required: true
|
||||||
description: Needs to match, exactly, the name of a milestone (NO v prefix)
|
description: Needs to match, exactly, the name of a milestone (NO v prefix)
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
@@ -14,11 +14,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repository: "grafana/grafana-github-actions"
|
repository: "grafana/grafana-github-actions"
|
||||||
path: ./actions
|
path: ./actions
|
||||||
ref: main
|
ref: main
|
||||||
- name: Install Actions
|
- name: Install Actions
|
||||||
run: npm install --production --prefix ./actions
|
run: npm install --production --prefix ./actions
|
||||||
|
- 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: Run github release action
|
- name: Run github release action
|
||||||
uses: ./actions/github-release
|
uses: ./actions/github-release
|
||||||
with:
|
with:
|
||||||
token: ${{secrets.GH_BOT_ACCESS_TOKEN}}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
||||||
|
|||||||
@@ -7,15 +7,27 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
jobs:
|
jobs:
|
||||||
call-remove-milestone:
|
call-remove-milestone:
|
||||||
uses: grafana/grafana/.github/workflows/remove-milestone.yml@main
|
- name: "Generate token"
|
||||||
with:
|
id: generate_token
|
||||||
version_call: ${{ github.event.inputs.version_input }}
|
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||||
secrets:
|
with:
|
||||||
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
|
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||||
|
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||||
|
- uses: grafana/grafana/.github/workflows/remove-milestone.yml@main
|
||||||
|
with:
|
||||||
|
version_call: ${{ github.event.inputs.version_input }}
|
||||||
|
secrets:
|
||||||
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
call-close-milestone:
|
call-close-milestone:
|
||||||
uses: grafana/grafana/.github/workflows/close-milestone.yml@main
|
- name: "Generate token"
|
||||||
with:
|
id: generate_token
|
||||||
version_call: ${{ github.event.inputs.version_input }}
|
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||||
secrets:
|
with:
|
||||||
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
|
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||||
needs: call-remove-milestone
|
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||||
|
- uses: grafana/grafana/.github/workflows/close-milestone.yml@main
|
||||||
|
with:
|
||||||
|
version_call: ${{ github.event.inputs.version_input }}
|
||||||
|
secrets:
|
||||||
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
|
needs: call-remove-milestone
|
||||||
|
|||||||
@@ -26,11 +26,17 @@ jobs:
|
|||||||
ref: main
|
ref: main
|
||||||
- name: Install Actions
|
- name: Install Actions
|
||||||
run: npm install --production --prefix ./actions
|
run: npm install --production --prefix ./actions
|
||||||
|
- 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: Remove milestone from open issues (manually invoked)
|
- name: Remove milestone from open issues (manually invoked)
|
||||||
if: ${{ github.event.inputs.version != '' }}
|
if: ${{ github.event.inputs.version != '' }}
|
||||||
uses: ./actions/remove-milestone
|
uses: ./actions/remove-milestone
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
- name: Remove milestone from open issues (workflow invoked)
|
- name: Remove milestone from open issues (workflow invoked)
|
||||||
if: ${{ inputs.version_call != '' }}
|
if: ${{ inputs.version_call != '' }}
|
||||||
uses: ./actions/remove-milestone
|
uses: ./actions/remove-milestone
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ jobs:
|
|||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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 Actions
|
- name: Checkout Actions
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -17,8 +23,8 @@ jobs:
|
|||||||
ref: main
|
ref: main
|
||||||
- name: Install Actions
|
- name: Install Actions
|
||||||
run: npm install --production --prefix ./actions
|
run: npm install --production --prefix ./actions
|
||||||
- name: Run update changelog (manually invoked)
|
- name: Run update changelog (manually invoked)
|
||||||
uses: ./actions/update-changelog
|
uses: ./actions/update-changelog
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
||||||
|
|||||||
Reference in New Issue
Block a user