Skip to content

Commit 43602d2

Browse files
committed
feat: run Updatecli
Signed-off-by: Olivier Vernin <olivier@vernin.me>
1 parent ab04a01 commit 43602d2

8 files changed

Lines changed: 188 additions & 31 deletions

File tree

.github/workflows/updatecli.yaml

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,35 @@
1-
---
2-
name: updatecli
3-
1+
name: Updatecli
42
on:
3+
release:
54
workflow_dispatch:
6-
push:
7-
pull_request:
85
schedule:
9-
# * is a special character in YAML so you have to quote this string
10-
# Run every hour
11-
- cron: '0 * * * *'
6+
# Run at 12:00 every Saterday every 14 days
7+
- cron: '0 12 */14 * 6'
128

139
jobs:
14-
updatecli:
10+
prepare:
1511
runs-on: ubuntu-latest
1612
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v2
13+
- name: "Checkout"
14+
uses: "actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3" # v6.0.0
1915

20-
- name: Diff
21-
uses: updatecli/updatecli-action@v1.19.0
22-
with:
23-
command: diff
24-
flags: "--config ./updatecli/updatecli.d"
25-
env:
26-
UPDATECLI_GITHUB_ACTOR: ${{ github.actor }}
27-
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
- uses: tibdex/github-app-token@v1.5
29-
id: generate_token
30-
if: github.ref == 'refs/heads/main'
16+
- name: "Setup updatecli"
17+
uses: "updatecli/updatecli-action@5ca36367fadc6ad94d590984fd9c696e783ec635" # v2.96.0
3118
with:
32-
app_id: ${{ secrets.UPDATECLIBOT_APP_ID }}
33-
private_key: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
34-
- name: Apply
35-
uses: updatecli/updatecli-action@v1.19.0
36-
if: github.ref == 'refs/heads/main'
19+
version: "v0.113.0-rc.1"
20+
21+
- name: "Set up Go"
22+
uses: "actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c" # v6.1.0
3723
with:
38-
command: apply
39-
flags: "--config ./updatecli/updatecli.d"
24+
go-version-file: "go.mod"
25+
id: go
26+
27+
- name: "Run updatecli"
28+
run: updatecli compose apply --clean-git-branches=true --experimental
4029
env:
41-
UPDATECLI_GITHUB_ACTOR: ${{ secrets.UPDATECLI_BOT_GITHUB_ACTOR }}
42-
UPDATECLI_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
30+
UPDATECLI_GITHUB_APP_CLIENT_ID: ${{ secrets.UPDATECLIBOT_APP_ID }}
31+
UPDATECLI_GITHUB_APP_PRIVATE_KEY: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
32+
UPDATECLI_GITHUB_APP_INSTALLATION_ID: ${{ secrets.UPDATECLIBOT_APP_INSTALLATION_ID }}
33+
UPDATECLI_UDASH_API_URL: ${{ secrets.UPDATECLI_UDASH_API_URL }}
34+
UPDATECLI_UDASH_ACCESS_TOKEN: ${{ secrets.UPDATECLI_UDASH_ACCESS_TOKEN }}
35+
UPDATECLI_UDASH_URL: ${{ secrets.UPDATECLI_UDASH_URL }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Updatecli Test
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
prepare:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: "Checkout"
14+
uses: "actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3" # v6.0.0
15+
16+
- name: "Setup updatecli"
17+
uses: "updatecli/updatecli-action@5ca36367fadc6ad94d590984fd9c696e783ec635" # v2.96.0
18+
with:
19+
version: "v0.113.0-rc.1"
20+
21+
- name: "Set up Go"
22+
uses: "actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c" # v6.1.0
23+
with:
24+
go-version-file: "go.mod"
25+
id: go
26+
27+
- name: "Test updatecli in dry-run mode"
28+
run: "updatecli compose diff"
29+
env:
30+
# This step is executed in untrusted context. We use a GitHub token with minimal permissions.
31+
GITHUB_ACTOR: ${{ github.actor }}
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Updatecli - Update
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
prepare:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "Checkout"
13+
uses: "actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3" # v6.0.0
14+
15+
- name: "Setup updatecli"
16+
uses: "updatecli/updatecli-action@5ca36367fadc6ad94d590984fd9c696e783ec635" # v2.96.0
17+
with:
18+
version: "v0.113.0-rc.1"
19+
20+
- name: "Set up Go"
21+
uses: "actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c" # v6.1.0
22+
with:
23+
go-version-file: "go.mod"
24+
id: go
25+
26+
- name: "Run updatecli only on existing pipelines"
27+
run: updatecli compose apply --clean-git-branches=true --existing-only=true --experimental
28+
env:
29+
UPDATECLI_GITHUB_APP_CLIENT_ID: ${{ secrets.UPDATECLIBOT_APP_ID }}
30+
UPDATECLI_GITHUB_APP_PRIVATE_KEY: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
31+
UPDATECLI_GITHUB_APP_INSTALLATION_ID: ${{ secrets.UPDATECLIBOT_APP_INSTALLATION_ID }}
32+
UPDATECLI_UDASH_API_URL: ${{ secrets.UPDATECLI_UDASH_API_URL }}
33+
UPDATECLI_UDASH_ACCESS_TOKEN: ${{ secrets.UPDATECLI_UDASH_ACCESS_TOKEN }}
34+
UPDATECLI_UDASH_URL: ${{ secrets.UPDATECLI_UDASH_URL }}

updatecli-compose.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
policies:
3+
- name: Local Updatecli Website Policies
4+
config:
5+
- updatecli/updatecli.d/
6+
values:
7+
- updatecli/values.d/scm_githubsearch.yaml
8+
9+
- name: Sync Updatecli values files from github.com/updatecli/updatecli
10+
policy: ghcr.io/updatecli/policies/file:0.3.2
11+
values:
12+
- updatecli/values.d/scm_githubsearch.yaml
13+
- updatecli/values.d/sync_gha_updatecli.yaml
14+
15+
- name: Update Updatecli policies
16+
policy: ghcr.io/updatecli/policies/updatecli/autodiscovery:0.7.0@sha256:6890c4b4093a80063f518101881098fab8211c986481641faaf797a9ad5a31c3
17+
values:
18+
- updatecli/values.d/scm.yaml
19+
20+
- name: Update githubactions
21+
policy: ghcr.io/updatecli/policies/autodiscovery/githubaction:0.3.0@sha256:3b5425da2a2a2b89bb69463f1294704c33730358c66140efb93cab14b2868b06
22+
values:
23+
- updatecli/values.d/scm.yaml
24+
25+
- name: Handle Updatecli version in GitHub action
26+
policy: ghcr.io/updatecli/policies/updatecli/githubaction:0.7.0@sha256:a97518f118b03d2f63f45378e1961028b07c23d53db91db892893ff240fa5f4e
27+
values:
28+
- updatecli/values.d/scm.yaml

updatecli/updatecli.d/license.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Bump udpatecli version
2+
version: v0.109.0
3+
4+
sources:
5+
default:
6+
name: Get License
7+
kind: file
8+
spec:
9+
file: "https://raw.githubusercontent.com/updatecli/updatecli/refs/heads/main/LICENSE"
10+
11+
targets:
12+
license:
13+
name: "chore: update LICENSE"
14+
kind: file
15+
spec:
16+
file: LICENSE
17+
forcecreate: true
18+
scmid: default
19+
20+
actions:
21+
default:
22+
title: "chore: update LICENSE"
23+
kind: "github/pullrequest"
24+
scmid: default
25+
spec:
26+
automerge: true
27+
labels:
28+
- chore
29+
30+
scms:
31+
default:
32+
kind: githubsearch
33+
spec:
34+
search: "{{ .scm.search }}"
35+
limit: {{ .scm.limit }}
36+
branch: "{{ .scm.branch }}"
37+
user: "{{ .scm.user }}"
38+
email: "{{ .scm.email }}"

updatecli/values.d/scm.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
scm:
2+
enabled: true
3+
user: updatecli
4+
email: bot@updatecli.io
5+
owner: updatecli
6+
repository: .github
7+
username: "updateclibot"
8+
branch: main
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
scm:
2+
enabled: true
3+
kind: githubsearch
4+
search: "org:updatecli archived:false"
5+
branch: "^main$|^master$"
6+
commitusingapi: true
7+
user: updateclibot
8+
limit: 0
9+
10+
automerge: false
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
src:
2+
url: "https://github.com/updatecli/udash.git"
3+
branch: "main"
4+
5+
files:
6+
- src: .github/workflows/updatecli.yaml
7+
dst: .github/workflows/updatecli.yaml
8+
- src: .github/workflows/updatecli_test.yaml
9+
dst: .github/workflows/updatecli_test.yaml
10+
- src: .github/workflows/updatecli_update.yaml
11+
dst: .github/workflows/updatecli_update.yaml
12+
13+
pr:
14+
automerge: true

0 commit comments

Comments
 (0)