updates #351
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: updates | |
"on": | |
workflow_dispatch: | |
schedule: | |
- cron: "0 8 * * *" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
updates: | |
runs-on: ubuntu-latest | |
if: github.repository == 'promhippie/charts' | |
steps: | |
- name: Generate token | |
id: token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.TOKEN_EXCHANGE_APP }} | |
installation_retrieval_mode: id | |
installation_retrieval_payload: ${{ secrets.TOKEN_EXCHANGE_INSTALL }} | |
private_key: ${{ secrets.TOKEN_EXCHANGE_KEY }} | |
permissions: >- | |
{"contents": "write", "pull_requests": "write", "issues": "write"} | |
- name: Checkout source | |
id: source | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.token.outputs.token }} | |
fetch-depth: 0 | |
- name: Setup golang | |
id: golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.23.0 | |
- name: Update versions | |
id: updater | |
run: | | |
go run ./internal/cmd/updater . | |
- name: Create request | |
id: request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
branch: update/versions | |
delete-branch: true | |
title: "chore: automated version updates" | |
body: "New versions generated, automerge should handle that!" | |
labels: renovate | |
token: ${{ steps.token.outputs.token }} | |
- name: Approve request | |
id: approve | |
if: steps.request.outputs.pull-request-operation == 'created' | |
run: gh pr review --approve "${{ steps.request.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Enable automerge | |
id: automerge | |
if: steps.request.outputs.pull-request-operation == 'created' | |
run: gh pr merge --rebase --auto "${{ steps.request.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ steps.token.outputs.token }} | |
- name: Create issue | |
id: issue | |
if: failure() | |
uses: dblock/create-a-github-issue@v3 | |
env: | |
GITHUB_TOKEN: ${{ steps.token.outputs.token }} | |
GITHUB_SERVER_URL: ${ github.server_url }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_RUN_ID: ${{ github.run_id }} | |
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }} | |
with: | |
filename: .github/workflow-issue.md | |
update_existing: true | |
search_existing: open | |
... |