-
Notifications
You must be signed in to change notification settings - Fork 43
79 lines (67 loc) · 2.14 KB
/
weekly-pulumi-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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