Skip to content

Commit

Permalink
Merge pull request #2 from loispostula/updatecli
Browse files Browse the repository at this point in the history
👷 bootstrap updatecli
  • Loading branch information
loispostula authored Nov 28, 2024
2 parents ac17017 + 84cfdf7 commit 0e80586
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: updatecli
on:
release: null
workflow_dispatch: null
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Run every hour
- cron: "0 0 * * *"

permissions: {}

jobs:
updatecli:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: "Checkout"
uses: "actions/[email protected]"
- name: "Setup updatecli"
uses: "updatecli/updatecli-action@v2"
- name: "Run updatecli in dryrun"
run: "updatecli compose diff"
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: "tibdex/[email protected]"
id: generate_token
if: github.ref == 'refs/heads/main'
with:
app_id: ${{ secrets.MBRELLA_BOT_APP_ID }}
private_key: ${{ secrets.MBRELLA_BOT_APP_PRIVKEY }}
- name: "Run updatecli"
if: github.ref == 'refs/heads/main'
run: "updatecli compose apply"
env:
GITHUB_ACTOR: ${{ vars.UPDATECLI_BOT_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
11 changes: 11 additions & 0 deletions updatecli-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
policies:
- name: Local Updatecli Policies
config:
- updatecli/updatecli.d/
values:
- updatecli/values.d/scm.yaml
- name: Update Updatecli policies
policy: ghcr.io/updatecli/policies/updatecli/autodiscovery:0.5.0@sha256:947817644fb89e27f7b7121b822328c2d47364c7a3a08241e4d2ac1a5897020c
values:
- updatecli/values.d/scm.yaml
- updatecli/values.d/updatecli-compose.yaml
28 changes: 28 additions & 0 deletions updatecli/updatecli.d/githubactions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ⬆️ github actions
pipelineid: github_actions

actions:
default:
kind: github/pullrequest
spec:
automerge: false
labels:
- chore
scmid: default
scms:
default:
kind: github
spec:
branch: '{{ .scm.branch }}'
email: '{{ .scm.email }}'
owner: '{{ .scm.owner }}'
repository: '{{ .scm.repository }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
user: '{{ .scm.user }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'

autodiscovery:
scmid: default
actionid: default
crawlers:
github/action:
9 changes: 9 additions & 0 deletions updatecli/values.d/scm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
scm:
commitusingapi: true
enabled: true
user: mbrella
email: [email protected]
owner: loispostula
repository: terraform-docs.el
username: "updatecli-bot"
branch: main
5 changes: 5 additions & 0 deletions updatecli/values.d/updatecli-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
spec:
files:
- "updatecli-compose.yaml"
only:
- path: "updatecli-compose.yaml"

0 comments on commit 0e80586

Please sign in to comment.