From 3d881cb807bae15e0be5db291c404397809d896b Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Kwon <855115+xiehan@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:36:13 +0100 Subject: [PATCH] chore(ci): add workflow that triggers upgrade-main in all provider repos --- .github/workflows/upgrade-main-providers.yml | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/upgrade-main-providers.yml diff --git a/.github/workflows/upgrade-main-providers.yml b/.github/workflows/upgrade-main-providers.yml new file mode 100644 index 0000000..fcbb0be --- /dev/null +++ b/.github/workflows/upgrade-main-providers.yml @@ -0,0 +1,36 @@ +name: "upgrade-main in all provider repos" +on: + workflow_dispatch: {} +concurrency: ${{ github.workflow }}-${{ github.ref }} +jobs: + build-provider-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: set-matrix + run: | + provider=$(jq -rcM "{ provider: keys }" provider.json) + echo "matrix=$provider" >> $GITHUB_OUTPUT + upgrade-main: + needs: build-provider-matrix + name: "Trigger upgrade-main" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: ${{fromJSON(needs.build-provider-matrix.outputs.matrix)}} + max-parallel: 10 + steps: + - name: Trigger the upgrade-main workflow + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + github-token: ${{ secrets.GH_COMMENT_TOKEN }} + script: | + await github.rest.actions.createworkflowDispatch({ + owner: "cdktf", + repo: "cdktf-provider-${{ matrix.provider }}", + workflow_id: "upgrade-main.yml", + ref: "main" + })