Skip to content

provider-upgrade

provider-upgrade #4044

# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: provider-upgrade
on:
schedule:
- cron: 8 3 * * *
workflow_dispatch: {}
jobs:
upgrade:
runs-on: custom-linux-medium
permissions:
pull-requests: write
issues: write
contents: write
statuses: write
env:
NODE_OPTIONS: --max-old-space-size=31744
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: 18.12.0
- 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@c5a7806660adbe173f04e3e038b0ccdcd758773c
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 <github-team-tf-cdk@hashicorp.com>
author: Team Terraform CDK <github-team-tf-cdk@hashicorp.com>
signoff: true