updatecli #6717
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: updatecli | |
on: | |
workflow_dispatch: null | |
schedule: | |
# Every monday | |
- cron: '* * * * 1' | |
push: null | |
pull_request: null | |
jobs: | |
updatecli: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup updatecli | |
uses: updatecli/updatecli-action@v2 | |
- name: Diff | |
continue-on-error: true | |
run: | | |
updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.yaml | |
env: | |
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
## This step allows to generate a short-lived token which is allowed to modify GitHub Workflow files (that the default GITHUB_TOKEN cannot) | |
## Please make sure that the 2 secrets are defined (usually at organization level, with a per-repository access) | |
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.0 | |
id: generate_token | |
if: github.ref == 'refs/heads/main' | |
with: | |
app_id: ${{ secrets.JENKINS_ADMIN_APP_ID }} | |
private_key: ${{ secrets.JENKINS_ADMIN_APP_PRIVKEY }} | |
- name: Apply | |
if: github.ref == 'refs/heads/main' | |
run: | | |
updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.yaml | |
env: | |
UPDATECLI_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} |