Sync cf-deployment release versions #40
This file contains hidden or 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: Sync cf-deployment release versions | |
| on: | |
| schedule: | |
| - cron: "0 6 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| sync-versions: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: main | |
| token: ${{ secrets.SERVICE_USER_GITHUB_TOKEN }} | |
| - name: Extract release versions and generate versions.yaml | |
| id: bump-versions | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG=$(gh release view --repo cloudfoundry/kind-deployment --json tagName --jq '.tagName') | |
| pip3 install pyyaml requests | |
| python3 scripts/sync-cf-deployment-versions.py $TAG | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - name: Create pull request | |
| env: | |
| GH_TOKEN: ${{ secrets.SERVICE_USER_GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "ard-wg-k8s-gitbot" | |
| git config user.email "kind-deployment@cloudfoundry.org" | |
| git checkout -b auto/sync-cf-deployment-versions | |
| if git diff --quiet; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| git add -A | |
| git commit -m "chore: update BOSH release versions from cf-deployment ${{ steps.bump-versions.outputs.tag }}" | |
| git push -f -u origin auto/sync-cf-deployment-versions | |
| gh pr create --fill --base main || echo "PR already exists" |