Skip to content

provider-upgrade

provider-upgrade #333

# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: provider-upgrade
on:
schedule:
- cron: 0 3 * * *
workflow_dispatch: {}
jobs:
upgrade:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: write
statuses: write
env:
NODE_OPTIONS: --max-old-space-size=6656
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- run: yarn install
- id: check_version
run: yarn check-if-new-provider-version
- name: get provider current version
id: current_version
if: ${{ steps.check_version.outputs.new_version == 'available' }}
run: echo "value=$(jq -r '.cdktf.provider.version' package.json)" >> $GITHUB_OUTPUT
- if: ${{ steps.check_version.outputs.new_version == 'available' }}
env:
CHECKPOINT_DISABLE: "1"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn fetch
- name: get provider updated version
id: new_version
if: ${{ steps.check_version.outputs.new_version == 'available' }}
run: echo "value=$(jq -r '. | to_entries[] | .value' src/version.json)" >> $GITHUB_OUTPUT
- name: Determine if this is a minor or patch release
id: release
if: ${{ steps.check_version.outputs.new_version == 'available' }}
env:
CURRENT_VERSION: ${{ steps.current_version.outputs.value }}
NEW_VERSION: ${{ steps.new_version.outputs.value }}
run: |-
CURRENT_VERSION_MINOR=$(cut -d "." -f 2 <<< "$CURRENT_VERSION")
NEW_VERSION_MINOR=$(cut -d "." -f 2 <<< "$NEW_VERSION")
[[ "$CURRENT_VERSION_MINOR" != "$NEW_VERSION_MINOR" ]] && IS_MINOR_RELEASE=true || IS_MINOR_RELEASE=false
[[ "$IS_MINOR_RELEASE" == "true" ]] && SEMANTIC_TYPE=feat || SEMANTIC_TYPE=fix
echo "is_minor=$IS_MINOR_RELEASE" >> $GITHUB_OUTPUT
echo "type=$SEMANTIC_TYPE" >> $GITHUB_OUTPUT
- if: ${{ steps.check_version.outputs.new_version == 'available' }}
run: yarn compile
- if: ${{ steps.check_version.outputs.new_version == 'available' }}
run: yarn docgen
- name: Create Pull Request
if: ${{ steps.check_version.outputs.new_version == 'available' }}
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
with:
branch: auto/provider-upgrade
commit-message: "${{ steps.release.outputs.type }}: upgrade provider from `${{ steps.current_version.outputs.value }}` to version `${{ steps.new_version.outputs.value }}`"
title: "${{ steps.release.outputs.type }}: upgrade provider from `${{ steps.current_version.outputs.value }}` to version `${{ steps.new_version.outputs.value }}`"
body: This PR upgrades the underlying Terraform provider to version ${{ steps.new_version.outputs.value }}
labels: automerge,auto-approve
token: ${{ secrets.GH_TOKEN }}
delete-branch: true
committer: team-tf-cdk <[email protected]>
author: Team Terraform CDK <[email protected]>
signoff: true