Skip to content

Commit

Permalink
misc: switch to using a GitHub app for Helm chart releases
Browse files Browse the repository at this point in the history
This switches to using [grafana-alloybot] for Helm chart releases
instead of the temporary PAT used for the initial release.

The secrets used by the workflow have been added to the repository
already.

[grafana-alloybot]: https://github.com/apps/grafana-alloybot
  • Loading branch information
rfratto committed Apr 22, 2024
1 parent ef9ee63 commit f2cbd5a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ jobs:
runs-on: ubuntu-latest
if: needs.setup.outputs.changed == 'true'
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.ALLOYBOT_APP_ID }}
private-key: ${{ secrets.ALLOYBOT_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -81,7 +87,7 @@ jobs:
fetch-depth: 0
repository: grafana/helm-charts
path: helm-charts
token: "${{ secrets.GH_BOT_ACCESS_TOKEN }}"
token: ${{ steps.app-token.outputs.token }}

- name: Configure Git for helm-charts
run: |
Expand Down Expand Up @@ -138,7 +144,7 @@ jobs:
name: ${{ steps.parse-chart.outputs.packagename }}
repository: grafana/helm-charts
tag_name: ${{ steps.parse-chart.outputs.packagename }}
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
token: ${{ steps.app-token.outputs.token }}
body: |
${{ steps.parse-chart.outputs.desc }}
Expand All @@ -157,4 +163,4 @@ jobs:
- name: Update helm-charts index.yaml
run: |
cd helm-charts
"${CR_TOOL_PATH}/cr" index --config "${CR_CONFIGFILE}" --token "${{ secrets.GH_BOT_ACCESS_TOKEN }}" --index-path "${CR_INDEX_PATH}" --package-path "${CR_PACKAGE_PATH}" --push
"${CR_TOOL_PATH}/cr" index --config "${CR_CONFIGFILE}" --token "${{ steps.app-token.outputs.token }}" --index-path "${CR_INDEX_PATH}" --package-path "${CR_PACKAGE_PATH}" --push

0 comments on commit f2cbd5a

Please sign in to comment.