-
Notifications
You must be signed in to change notification settings - Fork 104
75 lines (62 loc) · 2.33 KB
/
awsx-upgrade-aws.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
name: awsx-upgrade-aws
description: |
This weekly workflow creates Pull Requests to upgrade pulumi-aws dependency.
This dependency is a critical part of the AWSX project and should be kept up-to-date to inherit all the fixes and
improvements done upstream.
on:
schedule:
# Every Monday at 11AM UTC
- cron: 0 11 * * 1
# This stanza permits manual execution of the workflow.
workflow_dispatch: {}
jobs:
upgrade-aws:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.10.0
with:
repo: pulumi/pulumictl
- name: Prepare Git configuration
run: |
git config --local user.email 'bot@pulumi.com'
git config --local user.name 'pulumi-bot'
- name: Upgrade pulumi-aws dependency
id: upgrade
run: |
VERSION=$(./scripts/get-latest-aws-version.sh)
echo "Upgrading pulumi-aws to $VERSION"
./scripts/upgrade-aws.sh "$VERSION"
echo "Upgraded pulumi-aws to $VERSION"
if ! git diff-files --quiet; then
echo changes=1 >> "$GITHUB_OUTPUT"
echo version=$VERSION >> "$GITHUB_OUTPUT"
else
echo "No changes detected. Exiting."
fi
- name: Commit changes
if: steps.upgrade.outputs.changes != 0
env:
PULUMI_AWS_VERSION: ${{ steps.upgrade.outputs.version }}
run: |
branch="update-pulumi-aws/$PULUMI_AWS_VERSION-${{ github.run_id }}-${{ github.run_number }}"
msg="Update pulumi/pulumi-aws version to $PULUMI_AWS_VERSION"
git branch "$branch"
git checkout "$branch"
git add .
git commit -m "$msg"
git push origin "$branch"
- name: Create a Pull Request
if: steps.upgrade.outputs.changes != 0
env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
PULUMI_AWS_VERSION: ${{ steps.upgrade.outputs.version }}
run: |
branch="update-pulumi-aws/$PULUMI_AWS_VERSION-${{ github.run_id }}-${{ github.run_number }}"
title="Update pulumi/pulumi-aws version to $PULUMI_AWS_VERSION"
gh pr create \
--title "$title" \
--body "$title" \
--head "$branch"