From e413d0d6dd12493906392f5374a00b16497998eb Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Thu, 9 May 2024 15:35:43 +0100 Subject: [PATCH] Generate workflows to fix Go SDK publish Generated from PR: https://github.com/pulumi/ci-mgmt/pull/917 --- .github/workflows/master.yml | 27 ++++++++++++++++ .github/workflows/prerelease.yml | 27 ++++++++++++++++ .github/workflows/release.yml | 36 ++++++++++++++++++++++ .github/workflows/run-acceptance-tests.yml | 27 ++++++++++++++++ 4 files changed, 117 insertions(+) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 887cffce..f797534e 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -265,6 +265,33 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 0ccc3e8d..acae9300 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -212,6 +212,33 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 072a7355..a3ff04f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -226,6 +226,33 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} @@ -339,6 +366,15 @@ jobs: repo: pulumi/pulumictl - id: version uses: pulumi/provider-version-action@v1 + - name: Download Go SDK + uses: actions/download-artifact@v4 + with: + name: go-sdk.tar.gz + path: ${{ github.workspace }}/sdk/ + - name: Uncompress Go SDK + run: tar -zxf ${{ github.workspace }}/sdk/go.tar.gz -C + ${{ github.workspace }}/sdk/go + shell: bash - uses: pulumi/publish-go-sdk-action@v1 with: repository: ${{ github.repository }} diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index fd95c3c9..65ca40bf 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -236,6 +236,33 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}