Add empty lines check to findCodeBlocks to avoid panic (#3209) #60
Workflow file for this run
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
| permissions: write-all # Equivalent to default permissions plus id-token: write | |
| name: Update Providers with new bridge version upon release | |
| on: | |
| push: | |
| tags: | |
| # Automatically trigger on valid patch releases of the bridge. | |
| - "v*.*.*" | |
| - "!v*.*.*-**" # Do not propagate prereleases | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ESC_ACTION_OIDC_AUTH: true | |
| ESC_ACTION_OIDC_ORGANIZATION: pulumi | |
| ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization | |
| ESC_ACTION_ENVIRONMENT: imports/github-secrets | |
| ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false | |
| jobs: | |
| generate-providers-list: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: get-providers | |
| run: echo "providers=$(jq . <(curl https://raw.githubusercontent.com/pulumi/ci-mgmt/master/provider-ci/providers.json) --compact-output)" >> "$GITHUB_OUTPUT" | |
| outputs: | |
| providers: ${{ steps.get-providers.outputs.providers }} | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Upgrade ${{ matrix.provider }} to pulumi-terraform-bridge to the latest version automatically | |
| steps: | |
| - name: Fetch secrets from ESC | |
| id: esc-secrets | |
| uses: pulumi/esc-action@v1 | |
| - name: Check for provider hotfixes | |
| id: hotfix_check | |
| run: | | |
| # Get the latest release notes using gh CLI | |
| RELEASE_NOTES=$(gh release view --repo pulumi/pulumi-terraform-bridge --json body --jq '.body') | |
| # Check for [PROVIDER HOTFIX] in release notes | |
| if echo "$RELEASE_NOTES" | grep -q "\[PROVIDER HOTFIX\]"; then | |
| echo "has_hotfix=true" >> $GITHUB_OUTPUT | |
| echo "Found provider hotfix in release notes. Will trigger provider releases" | |
| else | |
| echo "has_hotfix=false" >> $GITHUB_OUTPUT | |
| echo "No provider hotfix found. Will not trigger provider releases" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Trigger upgrade | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }} | |
| repository: pulumi/pulumi-${{ matrix.provider }} | |
| event-type: upgrade-bridge | |
| # Not specifying target-bridge-version in the payload will make it upgrade to the latest. | |
| client-payload: |- | |
| { | |
| "pr-reviewers": ${{ toJSON( github.actor ) == 'pulumi-bot' && 'VenelinMartinov' || toJSON( github.actor || 'VenelinMartinov' ) }}, | |
| "automerge": true, | |
| "patch-release": ${{ steps.hotfix_check.outputs.has_hotfix }} | |
| } | |
| needs: generate-providers-list | |
| strategy: | |
| # GitHub recommends only issuing 1 API request per second, and never | |
| # concurrently. For more information, see: | |
| # https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits | |
| max-parallel: 1 | |
| matrix: | |
| provider: ${{ fromJson(needs.generate-providers-list.outputs.providers ) }} | |
| fail-fast: false |