Skip to content

Commit 9519e03

Browse files
authored
Merge pull request #12 from olblak/feat/enable/updatecli
One Updatecli job to control them all
2 parents b4b3cd9 + 3dd3b47 commit 9519e03

File tree

10 files changed

+163
-78
lines changed

10 files changed

+163
-78
lines changed

.github/workflows/updatecli.yaml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
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'
37-
with:
38-
command: apply
39-
flags: "--config ./updatecli/updatecli.d"
19+
version: "v0.113.0-rc.1"
20+
21+
- name: "Run updatecli"
22+
run: updatecli compose apply --clean-git-branches=true --experimental
4023
env:
41-
UPDATECLI_GITHUB_ACTOR: ${{ secrets.UPDATECLI_BOT_GITHUB_ACTOR }}
42-
UPDATECLI_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
24+
UPDATECLI_GITHUB_APP_CLIENT_ID: ${{ secrets.UPDATECLIBOT_APP_ID }}
25+
UPDATECLI_GITHUB_APP_PRIVATE_KEY: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
26+
UPDATECLI_GITHUB_APP_INSTALLATION_ID: ${{ secrets.UPDATECLIBOT_APP_INSTALLATION_ID }}
27+
UPDATECLI_UDASH_API_URL: ${{ secrets.UPDATECLI_UDASH_API_URL }}
28+
UPDATECLI_UDASH_ACCESS_TOKEN: ${{ secrets.UPDATECLI_UDASH_ACCESS_TOKEN }}
29+
UPDATECLI_UDASH_URL: ${{ secrets.UPDATECLI_UDASH_URL }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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: "Test updatecli in dry-run mode"
22+
run: "updatecli compose diff"
23+
env:
24+
# This step is executed in untrusted context. We use a GitHub token with minimal permissions.
25+
GITHUB_ACTOR: ${{ github.actor }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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: "Run updatecli only on existing pipelines"
21+
run: updatecli compose apply --clean-git-branches=true --existing-only=true --experimental
22+
env:
23+
UPDATECLI_GITHUB_APP_CLIENT_ID: ${{ secrets.UPDATECLIBOT_APP_ID }}
24+
UPDATECLI_GITHUB_APP_PRIVATE_KEY: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
25+
UPDATECLI_GITHUB_APP_INSTALLATION_ID: ${{ secrets.UPDATECLIBOT_APP_INSTALLATION_ID }}
26+
UPDATECLI_UDASH_API_URL: ${{ secrets.UPDATECLI_UDASH_API_URL }}
27+
UPDATECLI_UDASH_ACCESS_TOKEN: ${{ secrets.UPDATECLI_UDASH_ACCESS_TOKEN }}
28+
UPDATECLI_UDASH_URL: ${{ secrets.UPDATECLI_UDASH_URL }}

updatecli-compose.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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: Default - 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: Golang - Sync Updatecli values files from github.com/updatecli/updatecli
16+
policy: ghcr.io/updatecli/policies/file:0.3.2
17+
values:
18+
- updatecli/values.d/golang/scm_githubsearch.yaml
19+
- updatecli/values.d/golang/sync_gha_updatecli.yaml
20+
21+
- name: Update Updatecli policies
22+
policy: ghcr.io/updatecli/policies/updatecli/autodiscovery:0.7.0@sha256:6890c4b4093a80063f518101881098fab8211c986481641faaf797a9ad5a31c3
23+
values:
24+
- updatecli/values.d/scm.yaml
25+
26+
- name: Update githubactions
27+
policy: ghcr.io/updatecli/policies/autodiscovery/githubaction:0.3.0@sha256:3b5425da2a2a2b89bb69463f1294704c33730358c66140efb93cab14b2868b06
28+
values:
29+
- updatecli/values.d/scm.yaml
30+
31+
- name: Handle Updatecli version in GitHub action
32+
policy: ghcr.io/updatecli/policies/updatecli/githubaction:0.7.0@sha256:a97518f118b03d2f63f45378e1961028b07c23d53db91db892893ff240fa5f4e
33+
values:
34+
- updatecli/values.d/scm.yaml

updatecli/updatecli.d/updatecli.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.
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 language:Go 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: false

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/updatecli.git"
3+
branch: "main"
4+
5+
files:
6+
- src: CODE_OF_CONDCUCT.md
7+
dst: CODE_OF_CONDCUCT.md
8+
- src: LICENSE
9+
dst: LICENSE
10+
- src: .github/workflows/typos.yaml
11+
dst: .github/workflows/typos.yaml
12+
13+
pr:
14+
automerge: false

0 commit comments

Comments
 (0)