chore: make ci-mgmt
This commit is contained in:
38
.github/workflows/upgrade-provider.yml
vendored
38
.github/workflows/upgrade-provider.yml
vendored
@@ -22,14 +22,19 @@ on:
|
||||
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
|
||||
- cron: 0 3 * * *
|
||||
|
||||
env:
|
||||
PULUMI_API: https://api.pulumi-staging.io
|
||||
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
|
||||
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
|
||||
PULUMI_PROVIDER_AUTOMATION_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN }}
|
||||
PULUMI_PULUMI_ENABLE_JOURNALING: "true"
|
||||
TF_APPEND_USER_AGENT: pulumi
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
id-token: write # For ESC secrets.
|
||||
|
||||
jobs:
|
||||
upgrade_provider:
|
||||
@@ -37,14 +42,22 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
with:
|
||||
# Persist credentials so upgrade-provider can push a new branch.
|
||||
persist-credentials: true
|
||||
- name: Setup tools
|
||||
uses: ./.github/actions/setup-tools
|
||||
persist-credentials: true
|
||||
- id: esc-secrets
|
||||
name: Map environment to ESC outputs
|
||||
uses: ./.github/actions/esc-action
|
||||
- name: Setup mise
|
||||
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3
|
||||
env:
|
||||
MISE_FETCH_REMOTE_VERSIONS_TIMEOUT: 30s
|
||||
with:
|
||||
tools: pulumictl, pulumicli, dotnet, go, nodejs, python
|
||||
version: 2025.11.6
|
||||
github_token: ${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }}
|
||||
# only saving the cache in the prerequisites job
|
||||
cache_save: false
|
||||
- name: Install upgrade-provider
|
||||
run: go install github.com/pulumi/upgrade-provider@${{ inputs.upgradeProviderVersion || 'main' }}
|
||||
shell: bash
|
||||
@@ -60,6 +73,7 @@ jobs:
|
||||
run: upgrade-provider "$REPO" --kind=check-upstream-version
|
||||
env:
|
||||
REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ steps.esc-secrets.outputs.PULUMI_PROVIDER_AUTOMATION_TOKEN || steps.esc-secrets.outputs.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
- name: Calculate target version
|
||||
id: target_version
|
||||
@@ -71,7 +85,7 @@ jobs:
|
||||
id: upgrade_provider
|
||||
if: steps.target_version.outputs.version != ''
|
||||
continue-on-error: true
|
||||
uses: pulumi/pulumi-upgrade-provider-action@ff5cb5907aecba099e61146c4d4d074c7fd6ca99 # v0.0.15
|
||||
uses: pulumi/pulumi-upgrade-provider-action@e247104aede3eb4641f48c8ad0ea9de9346f2457 # v0.0.18
|
||||
with:
|
||||
kind: provider
|
||||
email: bot@pulumi.com
|
||||
@@ -79,10 +93,14 @@ jobs:
|
||||
automerge: true
|
||||
target-version: ${{ steps.target_version.outputs.version }}
|
||||
allow-missing-docs: true
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.esc-secrets.outputs.PULUMI_PROVIDER_AUTOMATION_TOKEN || steps.esc-secrets.outputs.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
- name: Comment on upgrade issue if automated PR failed
|
||||
if: steps.upgrade_provider.outcome == 'failure'
|
||||
shell: bash
|
||||
run: |
|
||||
issue_number=$(gh issue list --search "pulumiupgradeproviderissue" --repo "${{ github.repository }}" --json=number --jq=".[0].number")
|
||||
gh issue comment "${issue_number}" --repo "${{ github.repository }}" --body "Failed to create automatic PR: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/"
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.esc-secrets.outputs.PULUMI_PROVIDER_AUTOMATION_TOKEN || steps.esc-secrets.outputs.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user