Skip to content

Commit f86ba6c

Browse files
authored
Update Updatecli GitHub action workflow (#993)
* clean: updatecli update pipeline * chore: refactor updatecli workflow Signed-off-by: Olivier Vernin <[email protected]> --------- Signed-off-by: Olivier Vernin <[email protected]>
1 parent d9d94f0 commit f86ba6c

File tree

7 files changed

+112
-65
lines changed

7 files changed

+112
-65
lines changed

.github/workflows/updatecli.yaml

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,29 @@
1-
---
2-
name: updatecli
1+
name: Updatecli
32
on:
4-
merge_group:
5-
branches:
6-
- v2
7-
push:
8-
branches:
9-
- v2
10-
schedule:
11-
# Run once a day
12-
- cron: '*/10 * * * *'
3+
release:
134
workflow_dispatch:
14-
repository_dispatch:
15-
types:
16-
- "updatecli-release"
17-
permissions:
18-
actions: write
19-
contents: write
20-
pull-requests: write
5+
schedule:
6+
# Run at 12:00 every Saterday every 14 days
7+
- cron: "0 12 */14 * 6"
8+
219
jobs:
2210
updatecli:
2311
runs-on: ubuntu-latest
2412
steps:
25-
- name: Checkout
26-
uses: actions/checkout@v4
27-
- name: Set Node.js 20.x
28-
uses: actions/[email protected]
29-
with:
30-
node-version: 20
31-
cache: npm
13+
- name: "Checkout"
14+
uses: "actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3" # v6.0.0
15+
3216
- name: "Setup updatecli"
33-
uses: "updatecli/[email protected]"
34-
- name: "Run updatecli in dryrun"
35-
run: "updatecli compose diff"
36-
env:
37-
GITHUB_ACTOR: ${{ github.actor }}
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
- uses: tibdex/[email protected]
40-
id: generate_token
41-
if: github.ref == 'refs/heads/v2'
17+
uses: "updatecli/updatecli-action@5ca36367fadc6ad94d590984fd9c696e783ec635" # v2.96.0
4218
with:
43-
app_id: ${{ secrets.UPDATECLIBOT_APP_ID }}
44-
private_key: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
19+
version: "v0.113.0-rc.1"
20+
4521
- name: "Run updatecli"
46-
if: github.ref == 'refs/heads/v2'
47-
run: "updatecli compose apply"
22+
run: updatecli compose apply --clean-git-branches=true --experimental
4823
env:
49-
GITHUB_ACTOR: ${{ secrets.UPDATECLI_BOT_GITHUB_ACTOR }}
50-
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+
updatecli:
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+
updatecli:
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 }}

update-compose.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

updatecli-compose.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
policies:
2+
- name: Local Updatecli Website Policies
3+
config:
4+
- updatecli/updatecli.d/
5+
values:
6+
- updatecli/values.d/scm.yaml
7+
8+
- name: Handle Nodejs version in githubaction
9+
policy: ghcr.io/updatecli/policies/nodejs/githubaction:0.8.0@sha256:e0784741fa1628f498336c5154ad406df587fe7fa4c163f23deeed3ffc8809d2
10+
values:
11+
- updatecli/values.d/scm.yaml
12+
- updatecli/values.d/nodejs.yaml
13+
14+
- name: Update Updatecli policies
15+
policy: ghcr.io/updatecli/policies/updatecli/autodiscovery:0.5.0@sha256:947817644fb89e27f7b7121b822328c2d47364c7a3a08241e4d2ac1a5897020c
16+
values:
17+
- updatecli/values.d/scm.yaml
18+
19+
- name: NPM autodiscovery
20+
policy: ghcr.io/updatecli/policies/npm/autodiscovery:0.9.0@sha256:bfb7aaa719c26db1e13095fec27c143cf2c99b64b577d200a0bb658b724d37ae
21+
values:
22+
- updatecli/values.d/scm.yaml
23+
- updatecli/values.d/npm.yaml
24+
25+
- name: Handle Updatecli version in GitHub action
26+
policy: ghcr.io/updatecli/policies/updatecli/githubaction:0.4.0@sha256:2879297d2f973081e67b560066f1640304a173167d5b1e8e1452c02920cdbf4d
27+
values:
28+
- updatecli/values.d/scm.yaml
29+
30+
- name: Handle GitHub action version update
31+
policy: ghcr.io/updatecli/policies/autodiscovery/githubaction:0.2.1@sha256:cfddec11464cc09615135f0f1e069f00ad24d28edc7cc6a4e8224e04c3699008
32+
values:
33+
- updatecli/values.d/scm.yaml
34+
- updatecli/values.d/githubaction.yaml
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
specs:
2+
digest: true

updatecli/values.d/npm.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
automerge: true
22
groupby: individual
3+
4+
spec:
5+
ignoreversionconstraints: true

0 commit comments

Comments
 (0)