Upgrade bridge #1
This file contains 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
# WARNING: This file was build based on https://github.com/pulumi/ci-mgmt | |
# but it is currently not in sync. Any update must be done manually | |
name: Upgrade bridge | |
on: | |
repository_dispatch: | |
types: | |
- upgrade-bridge | |
workflow_dispatch: | |
inputs: | |
target-bridge-version: | |
description: pulumi-terraform-bridge version or hash reference | |
required: false | |
type: string | |
default: "latest" | |
pr-reviewers: | |
description: Reviewers to assign to the auto-opened pull request | |
required: false | |
type: string | |
default: "" | |
pr-description: | |
description: Extra description to add to the auto-opened pull request | |
required: false | |
type: string | |
default: "" | |
automerge: | |
description: Mark created PR for auto-merging? | |
required: false | |
type: boolean | |
default: false | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
upgrade_provider: | |
name: upgrade-provider | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Call upgrade provider action | |
if: github.event_name == 'workflow_dispatch' | |
uses: pulumi/[email protected] | |
with: | |
kind: bridge | |
email: [email protected] | |
username: GitHub | |
automerge: ${{ inputs.automerge }} | |
target-bridge-version: ${{ inputs.target-bridge-version }} | |
pr-reviewers: ${{ inputs.pr-reviewers }} | |
pr-description: ${{ inputs.pr-description }} | |
pr-title-prefix: "feat: " | |
- name: Call upgrade provider action | |
# TODO(ocobles): upgrade-provider tool tries to assign the PR to the user who created it. | |
# Since we don't have an Equinix bot user, we are using the GITHUB_TOKEN. This results in an | |
# error when trying to assign the PR to the user of the token (github-action). As a workaround | |
# we override the assign user. The pulumi-upgrade-provider-action does not have this option so | |
# we temporarily overwrite the action locally with a pr-assign input. | |
# Set pulumi-upgrade-provider-action back when pr-assign is available or we have a an Equinix bot token | |
# | |
# uses: pulumi/[email protected] | |
uses: ./.github/actions/upgrade-provider | |
with: | |
kind: bridge | |
email: [email protected] | |
username: GitHub | |
automerge: ${{ inputs.automerge }} | |
target-bridge-version: ${{ inputs.target-bridge-version }} | |
pr-reviewers: ${{ inputs.pr-reviewers }} | |
pr-description: ${{ inputs.pr-description }} | |
pr-assign: ${{ github.actor }} | |
pr-title-prefix: "feat: " | |
# TODO(ocobles) Set back when pr-assign is available or we have an Equinix bot token | |
# - name: Call upgrade provider action | |
# if: github.event_name == 'repository_dispatch' | |
# uses: pulumi/[email protected] | |
# with: | |
# kind: bridge | |
# email: [email protected] | |
# username: GitHub | |
# automerge: ${{ github.event.client_payload.automerge }} | |
# target-bridge-version: ${{ github.event.client_payload.target-bridge-version }} | |
# pr-reviewers: ${{ github.event.client_payload.pr-reviewers }} | |
# pr-description: ${{ github.event.client_payload.pr-description }} |