Github Actions: Fix milestone GH action (#70490)

* Remove secret from the caller action

* Inherit secrets for reusable actions
This commit is contained in:
Dimitris Sotirakis 2023-06-22 12:39:51 +03:00 committed by GitHub
parent c45ff94806
commit 37db29db63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 31 deletions

View File

@ -11,9 +11,7 @@ on:
description: Needs to match, exactly, the name of a milestone
required: true
type: string
secrets:
token:
required: true
jobs:
main:
runs-on: ubuntu-latest
@ -42,4 +40,4 @@ jobs:
uses: ./actions/close-milestone
with:
version_call: ${{ inputs.version_call }}
token: ${{ secrets.token }}
token: ${{ steps.generate_token.outputs.token }}

View File

@ -7,27 +7,13 @@ on:
required: true
jobs:
call-remove-milestone:
- 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 }}
- uses: grafana/grafana/.github/workflows/remove-milestone.yml@main
with:
version_call: ${{ github.event.inputs.version_input }}
secrets:
token: ${{ steps.generate_token.outputs.token }}
uses: grafana/grafana/.github/workflows/remove-milestone.yml@main
with:
version_call: ${{ github.event.inputs.version_input }}
secrets: inherit
call-close-milestone:
- 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 }}
- 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
uses: grafana/grafana/.github/workflows/close-milestone.yml@main
with:
version_call: ${{ github.event.inputs.version_input }}
secrets: inherit
needs: call-remove-milestone

View File

@ -11,9 +11,7 @@ on:
description: Needs to match, exactly, the name of a milestone
required: true
type: string
secrets:
token:
required: true
jobs:
main:
runs-on: ubuntu-latest
@ -42,4 +40,4 @@ jobs:
uses: ./actions/remove-milestone
with:
version_call: ${{ inputs.version_call }}
token: ${{ secrets.token }}
token: ${{ steps.generate_token.outputs.token }}