weekly-pulumi-update #140
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.23.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@v5 | |
with: | |
go-version: ${{matrix.goversion}} | |
cache-dependency-path: | | |
**/go.sum | |
- name: Install golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
skip-cache: true | |
version: v1.62 | |
- name: Update Pulumi/Pulumi | |
id: gomod | |
run: >- | |
git config --local user.email '[email protected]' | |
git config --local user.name 'pulumi-bot' | |
PULUMI_VERSION=$(go run scripts/build.go latest-pulumi-version) | |
echo "Latest Pulumi version is $PULUMI_VERSION" | |
git checkout -b update-pulumi/${{ github.run_id }}-${{ github.run_number }} | |
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 changes=1 >> "$GITHUB_OUTPUT" | |
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 |