rancher-partner-charts/.github/workflows/update-main-source.yml

54 lines
1.7 KiB
YAML
Raw Normal View History

name: Auto-update charts on main-source branch
on:
workflow_dispatch: {}
schedule:
- cron: '0 0 * * *'
jobs:
update:
permissions:
2024-04-17 19:27:59 +00:00
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Get rancher/partner-charts secrets out of vault
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/rancher/partner-charts/github/app-credentials appId | APP_ID ;
secret/data/github/repo/rancher/partner-charts/github/app-credentials privateKey | PRIVATE_KEY
- name: Generate short-lived github app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}
- name: Update main-source branch
env:
2024-04-17 17:54:28 +00:00
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
2024-04-18 17:58:00 +00:00
test -n "${{ steps.app-token.outputs.token }}"
test -n "$GITHUB_TOKEN"
test -n "${{ env.GITHUB_TOKEN }}"
test "$GITHUB_TOKEN" = "${{ steps.app-token.outputs.token }}"
test "${{ env.GITHUB_TOKEN }}" = "${{ steps.app-token.outputs.token }}"
2024-04-18 17:22:54 +00:00
scripts/pull-ci-scripts
bin/partner-charts-ci auto
# exit if there are no changes
git diff --quiet origin/main-source main-source && exit 0
2024-04-18 17:58:00 +00:00
# git push origin main-source
2024-04-17 19:27:59 +00:00
# git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/partner-charts