Skip to content

Commit aaa15fe

Browse files
authored
chore: update updatecli policy with new supported featured (#2133)
* chore: rename updatecli compose file * chore: add reviewer to docs PR chore: use github api to commit change * chore: add reviewer to jsonschema generated PR chore: commit using the github api * chore: refactor jsonschema updatecli policy * refactor jsonchema policy to remove useless script * commit changes via the GitHub api * add reviewers to generated pullrequest * chore: by default updatecli should commit changes via GitHub api * chore: rename weekly updatecli-compose.yaml file
1 parent 20407a0 commit aaa15fe

File tree

7 files changed

+30
-42
lines changed

7 files changed

+30
-42
lines changed

.github/workflows/updatecli.weekly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
private_key: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
3030
- name: "Run updatecli"
3131
if: github.ref == 'refs/heads/master'
32-
run: "updatecli compose apply --file update-compose.weekly.yaml"
32+
run: "updatecli compose apply --file updatecli-compose.weekly.yaml"
3333
env:
3434
GITHUB_ACTOR: ${{ secrets.UPDATECLI_BOT_GITHUB_ACTOR }}
3535
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ policies:
33
policy: ghcr.io/updatecli/policies/releasepost/releasepost:0.8.0@sha256:db9611131606c23c44c2883f0cdce46cd2476ef9bfdcd1221e420b39755e6f2a
44
values:
55
- updatecli/values.d/scm.yaml
6+
- updatecli/values.d/releasepost.yaml

updatecli/updatecli.d/docs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ actions:
77
kind: github/pullrequest
88
spec:
99
automerge: true
10+
reviewers:
11+
- updatecli/core
1012
labels:
1113
- chore
1214
mergemethod: squash
@@ -24,6 +26,7 @@ scms:
2426
user: updatecli
2527
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
2628
force: true
29+
commitusingapi: true
2730
disabled: false
2831

2932
targets:

updatecli/updatecli.d/installation.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ actions:
66
kind: github/pullrequest
77
spec:
88
automerge: true
9+
reviewers:
10+
- updatecli/core
911
labels:
1012
- chore
1113
mergemethod: squash
@@ -22,7 +24,7 @@ scms:
2224
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
2325
user: updatecli
2426
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
25-
force: true
27+
commitusingapi: true
2628
disabled: false
2729

2830
sources:

updatecli/updatecli.d/jsonschema.yaml

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ actions:
66
kind: github/pullrequest
77
spec:
88
automerge: true
9+
reviewers:
10+
- updatecli/core
911
labels:
1012
- chore
13+
- documentation
1114
mergemethod: squash
1215
scmid: default
16+
1317
scms:
1418
default:
1519
kind: github
@@ -21,50 +25,27 @@ scms:
2125
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
2226
user: updatecli
2327
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
24-
force: true
28+
commitusingapi: true
2529
disabled: false
2630

2731
targets:
28-
jsonschema:
29-
name: 'chore: update Updatecli jsonschema'
30-
kind: shell
31-
spec:
32-
command: |
33-
set -eux
34-
WORKDIR="."
35-
36-
OLD_CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/config.json)
37-
OLD_COMPOSE_CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/compose/config.json)
38-
OLD_POLICY_MANIFEST_CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/policy/manifest/config.json)
39-
OLD_POLICY_METADATA_CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/policy/metadata/config.json)
40-
41-
updatecli jsonschema --baseid https://www.updatecli.io/latest/schema --directory $WORKDIR/content/en/schema/latest
42-
43-
CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/config.json)
44-
COMPOSE_CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/compose/config.json)
45-
POLICY_MANIFEST_CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/policy/manifest/config.json)
46-
POLICY_METADATA_CHECKSUM=$(wc -c < $WORKDIR/content/en/schema/latest/policy/metadata/config.json)
47-
48-
if [ "$OLD_CHECKSUM" != "$CHECKSUM" ]; then
49-
echo "Default jsonschema change detected"
50-
fi
51-
52-
if [ "$OLD_COMPOSE_CHECKSUM" != "$COMPOSE_CHECKSUM" ]; then
53-
echo "Compose jsonschema change detected"
54-
fi
55-
56-
if [ "$OLD_POLICY_MANIFEST_CHECKSUM" != "$POLICY_MANIFEST_CHECKSUM" ]; then
57-
echo "Policy manifest jsonschema change detected"
58-
fi
59-
60-
if [ "$OLD_POLICY_METADATA_CHECKSUM" != "$POLICY_METADATA_CHECKSUM" ]; then
61-
echo "Policy metadata jsonschema change detected"
62-
fi
63-
64-
exit 0
32+
jsonschema:
33+
name: 'chore: update Updatecli jsonschema'
34+
kind: shell
35+
spec:
36+
changedif:
37+
kind: file/checksum
38+
spec:
39+
files:
40+
- content/en/schema/latest/config.json
41+
- content/en/schema/latest/compose/config.json
42+
- content/en/schema/latest/policy/manifest/config.json
43+
- content/en/schema/latest/policy/metadata/config.json
44+
command: |
45+
updatecli jsonschema --baseid https://www.updatecli.io/latest/schema --directory content/en/schema/latest
6546
66-
environments:
47+
environments:
6748
- name: PATH
68-
scmid: default
49+
scmid: default
6950

7051
version: 0.64.1

updatecli/values.d/scm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ scm:
66
repository: website
77
username: "updatecli-bot"
88
branch: master
9+
commitusingapi: true

0 commit comments

Comments
 (0)