Update Chart Versions #124
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
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| name: Update Chart Versions | |
| jobs: | |
| update-chart-versions: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install node | |
| uses: actions/setup-node@v4.4.0 | |
| with: | |
| node-version: "18" | |
| - name: Fetch Latest Flipt Release Tag | |
| id: fetch_tag | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG=$(gh release view -R flipt-io/flipt --json tagName | jq -r .tagName) | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - name: Update Chart Versions | |
| id: update_chart | |
| run: | | |
| TAG="${{ steps.fetch_tag.outputs.tag }}" | |
| pushd scripts/bumpVersion | |
| npm install | |
| npm run bump ../../charts/flipt/Chart.yaml "${TAG}" | |
| popd | |
| - name: Generate token | |
| id: generate_token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.FLIPT_RELEASE_BOT_APP_ID }} | |
| private_key: ${{ secrets.FLIPT_RELEASE_BOT_APP_PEM }} | |
| installation_id: ${{ secrets.FLIPT_RELEASE_BOT_INSTALLATION_ID }} | |
| - name: Open PR | |
| env: | |
| GIT_AUTHOR_NAME: flipt-bot | |
| GIT_AUTHOR_EMAIL: dev@flipt.io | |
| GIT_COMMITTER_NAME: flipt-bot | |
| GIT_COMMITTER_EMAIL: dev@flipt.io | |
| GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| run: | | |
| TAG="${{ steps.fetch_tag.outputs.tag }}" | |
| BRANCH_NAME="update/${TAG}-$(date +%s)" | |
| git checkout -b "${BRANCH_NAME}" | |
| git add charts/flipt/Chart.yaml | |
| git commit -m "feat: update Flipt version to release ${TAG}" | |
| git push origin "${BRANCH_NAME}" | |
| gh pr create --title "feat: update Flipt version to release ${TAG}" \ | |
| --head "${BRANCH_NAME}" \ | |
| --body "Updating chart to Flipt release [${TAG}](https://github.com/flipt-io/flipt/releases/tag/${TAG})." |