Skip to content

Commit

Permalink
Add workflow template for cron job checking for upstream upgrades (#736)
Browse files Browse the repository at this point in the history
This PR adds a workflow that runs once a day on a schedule and plans to
use the changes in pulumi/upgrade-provider#207 to poll upstream for
upgrades, resulting in the creation of a "Upgrade terraform-provider-foo
to vx.y.z" issue.

To assist during feature rollout, this PR targets 10 Tier 2 providers
(incidentally these are all from a single Zapier handler that we plan to
disable for careful rollout) to receive these new upgrade workflows.

To look at a few example trials of this Workflow, [follow the links in
this
comment](#724 (comment))

Part of #724.
  • Loading branch information
guineveresaenger authored Dec 8, 2023
1 parent 67ad7f3 commit 4e52d3f
Showing 1 changed file with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#{{- if or (eq .Config.provider "linode" "digitalocean" "vsphere" "gitlab" "datadog" "consul" "signalfx" "fastly" "alicloud" "rancher2") }}#
#WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
jobs:
check_upgrade_provider:
name: Check for upstream provider upgrades
runs-on: #{{ .Config.runner.default }}#
steps:
#{{ .Config.actions.setupGo | toYaml | indent 4 }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
shell: bash
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: git config --global user.name pulumi-bot
shell: bash
- name: "Set up git identity: email"
run: git config --global user.email [email protected]
shell: bash
- name: Run upgrade-provider upstream check
id: upstream_version
run: |
upgrade-provider "$REPO" --kind=check-upstream-version
env:
REPO: ${{ github.repository }}
shell: bash
- name: Send Check Version Failure To Slack
if: failure()
uses: #{{ .Config.actionVersions.slackNotification }}#
env:
SLACK_CHANNEL: provider-upgrade-publish-status
SLACK_COLOR: "#FF0000"
SLACK_ICON_EMOJI: ":owl:"
SLACK_MESSAGE: " Failed to check upstream for a new version "
SLACK_TITLE: ${{ github.event.repository.name }} upstream version check
SLACK_USERNAME: provider-bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
name: Check upstream upgrade
on:
workflow_dispatch: {} #so we can run this manually if necessary.
schedule:
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
- cron: 0 3 * * *
#{{ end -}}#

0 comments on commit 4e52d3f

Please sign in to comment.