Upgrade provider #19
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 provider | |
on: | |
issues: | |
types: | |
- opened | |
workflow_dispatch: {} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEFAULT_PR_ASSIGN: ocobles | |
jobs: | |
upgrade_provider: | |
if: ${{ contains(github.event.issue.title, 'Upgrade terraform-provider-') || github.event_name == 'workflow_dispatch' }} | |
name: upgrade-provider | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Set pr-assign variable | |
id: set-pr-assign | |
run: | | |
if [ "${{ github.actor }}" == "github-actions[bot]" ]; then | |
echo "PR_ASSIGN=${{ env.DEFAULT_PR_ASSIGN }}" >> $GITHUB_ENV | |
else | |
echo "PR_ASSIGN=${{ github.actor }}" >> $GITHUB_ENV | |
fi | |
- 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 bot token | |
# | |
# uses: pulumi/[email protected] | |
uses: ./.github/actions/upgrade-provider | |
with: | |
kind: all | |
email: [email protected] | |
username: GitHub | |
pr-assign: ${{ env.PR_ASSIGN }} |