weekly-pulumi-update #59
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
name: weekly-pulumi-update | |
on: | |
schedule: | |
- cron: 35 12 * * 4 | |
workflow_dispatch: {} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} | |
jobs: | |
weekly-pulumi-update: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
goversion: | |
- 1.20.x | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Unshallow clone for tags | |
run: git fetch --prune --unshallow --tags | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{matrix.goversion}} | |
cache-dependency-path: | | |
**/go.sum | |
- name: Install latest pulumi | |
uses: pulumi/actions@v4 | |
- name: Install golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
skip-cache: true | |
skip-pkg-cache: true | |
skip-build-cache: true | |
version: v1.51.2 | |
- name: Update Pulumi/Pulumi | |
id: gomod | |
run: >- | |
git config --local user.email '[email protected]' | |
git config --local user.name 'pulumi-bot' | |
git checkout -b update-pulumi/${{ github.run_id }}-${{ github.run_number }} | |
PULUMI_VERSION=$(pulumi version) | |
echo "Update Pulumi dependencies to $PULUMI_VERSION" | |
go run scripts/build.go update-pulumi-deps "$PULUMI_VERSION" | |
make tidy | |
git update-index -q --refresh | |
if ! git diff-files --quiet; then | |
echo ::set-output name=changes::1 | |
fi | |
- name: Bridge Pulumi Upgrade | |
if: steps.gomod.outputs.changes != 0 | |
run: >- | |
make build && make lint && make test | |
git add . | |
git commit -m "Updated modules" | |
git push origin update-pulumi/${{ github.run_id }}-${{ github.run_number }} | |
- name: Create PR | |
id: create-pr | |
if: steps.gomod.outputs.changes != 0 | |
uses: repo-sync/[email protected] | |
with: | |
source_branch: update-pulumi/${{ github.run_id }}-${{ github.run_number }} | |
destination_branch: master | |
pr_title: Automated Pulumi/Pulumi upgrade | |
github_token: ${{ secrets.PULUMI_BOT_TOKEN }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} | |
name: weekly-pulumi-update |