forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (99 loc) · 3.14 KB
/
Copy pathupdate-generated.yaml
File metadata and controls
101 lines (99 loc) · 3.14 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Update generated files
on:
workflow_dispatch: {}
schedule:
- cron: "0 5 * * Thu"
env:
DEFAULT_BRANCH: main
jobs:
update_maxpods:
name: Update maxpods and open PR
runs-on: ubuntu-latest
env:
UPDATE_BRANCH: update-maxpods
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: "^1.14"
- name: Update maxpods
run: make update-maxpods
- name: Setup identity as weaveworksbot
uses: ./.github/actions/setup-identity
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Commit changes
run: |
git checkout $DEFAULT_BRANCH
git checkout -B $UPDATE_BRANCH
git add -u
EDITOR=true git commit -m "Update maxpods"
! git diff --exit-code $DEFAULT_BRANCH HEAD
git push --force-with-lease origin HEAD
- uses: actions/github-script@v2.0.0
name: Open PR to ${{env.DEFAULT_BRANCH}}
with:
github-token: ${{ secrets.WEAVEWORKSBOT_TOKEN }}
script: |
const { data: pr } = await github.pulls.create({
...context.repo,
title: "Update maxpods",
head: "${{ env.UPDATE_BRANCH }}",
base: "${{ env.DEFAULT_BRANCH }}",
});
await github.issues.addLabels({
...context.repo,
issue_number: pr.number,
labels: ["kind/improvement"],
});
update_aws_node:
name: Update aws-node and open PR
runs-on: ubuntu-latest
container: weaveworks/eksctl-build:6a5c1c6359adec3d65c6791fbf04f2fe9e9fe768
env:
UPDATE_BRANCH: update-aws-node
GOPRIVATE: ""
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache go-build and mod
uses: actions/cache@v2
with:
path: |
~/.cache/go-build/
~/go/pkg/mod/
key: ${{ hashFiles('go.sum') }}
- name: Update aws-node
run: make update-aws-node
- name: Commit changes
run: |
git checkout $DEFAULT_BRANCH
git checkout -B $UPDATE_BRANCH
git config user.name "weaveworksbot"
git config user.email "weaveworksbot@users.noreply.github.com"
git add -u
EDITOR=true git commit -m "Update aws-node"
! git diff --exit-code $DEFAULT_BRANCH HEAD
git push --force-with-lease origin HEAD
- uses: actions/github-script@v2.0.0
name: Open PR to ${{env.DEFAULT_BRANCH}}
with:
github-token: ${{ secrets.WEAVEWORKSBOT_TOKEN }}
script: |
const { data: pr } = await github.pulls.create({
...context.repo,
title: "Update aws-node",
head: "${{ env.UPDATE_BRANCH }}",
base: "${{ env.DEFAULT_BRANCH }}",
});
await github.issues.addLabels({
...context.repo,
issue_number: pr.number,
labels: ["kind/improvement"],
});