-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (45 loc) · 1.8 KB
/
Copy pathupdatecli.yaml
File metadata and controls
49 lines (45 loc) · 1.8 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
name: Updatecli
on:
# Allow to manually trigger Updatecli
workflow_dispatch:
# Trigger Updatecli on main branch changes
# To rebase existing PR
push:
branches: [main]
# Trigger Updatecli pullrequest to test potential changes
pull_request:
branches: [main]
# Periodically checks update
schedule:
# Run every hour
- cron: "0 * * * *"
jobs:
updatecli:
name: Run Updatecli
runs-on: ubuntu-latest
permissions:
contents: write # for updatecli to update the repository
pull-requests: write # for updatecli to create a PR
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@2cc8e6d8e356d76b0280cdd03766c36596a0614e # v3.0.0
- name: Run Updatecli (dryrun)
if: github.ref != 'refs/heads/main'
env:
# Until this repository is under the rancher-sandbox GitHub organisation
# It's easier to use the default GITHUB_TOKEN but ultimately
# it's gonna be better to use a GitHub App token
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATECLI_GITHUB_OWNER: ${{ github.repository_owner }}
run: "updatecli compose diff --file updatecli/updatecli-compose.yaml"
- name: Run Updatecli
if: github.ref == 'refs/heads/main'
env:
# Until this repository is under the rancher-sandbox GitHub organisation
# It's easier to use the default GITHUB_TOKEN but ultimately
# it's gonna be better to use a GitHub App token
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATECLI_GITHUB_OWNER: ${{ github.repository_owner }}
run: "updatecli compose apply --file updatecli/updatecli-compose.yaml"