Skip to content

Commit 82a3f17

Browse files
authored
Merge pull request #39 from olblak/main
feat(githubaction): init github action autodiscovery policy
2 parents 56adcf8 + ca45c79 commit 82a3f17

File tree

6 files changed

+109
-0
lines changed

6 files changed

+109
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 0.1.0
4+
5+
* Init policy
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
authors:
2+
- Olblak <me@olblak.com>
3+
4+
url: "https://github.com/updatecli/policies/"
5+
documentation: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/githubaction/README.md"
6+
changelog: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/githubaction/CHANGELOG.md"
7+
source: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/githubaction/"
8+
version: 0.1.0
9+
vendor: Updatecli Project
10+
11+
licenses:
12+
- "Apache-2.0 license"
13+
14+
description: |
15+
GitHub action Autodiscovery
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# README
2+
3+
This Updatecli policy tries to detected available GitHub action workflow update.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
scm:
2+
enabled: true
3+
user: updatecli-bot
4+
email: updatecli-bot@updatecli.io
5+
owner: updatecli
6+
repository: udash
7+
#token: "xxx"
8+
username: "updatecli"
9+
branch: main
10+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
# Helpers
3+
# {{ $GitHubUser := env ""}}
4+
# {{ $GitHubRepositoryList := env "GITHUB_REPOSITORY" | split "/"}}
5+
# {{ $GitHubPAT := env "GITHUB_TOKEN"}}
6+
# {{ $GitHubUsername := env "GITHUB_ACTOR"}}
7+
8+
name: '{{ .name }}'
9+
#{{ if .pipelineid }}
10+
pipelineid: '{{ .pipelineid }}'
11+
#{{ end }}
12+
13+
autodiscovery:
14+
groupby: {{ .groupby }}
15+
#{{ if or (.scm.enabled) (env "GITHUB_REPOSITORY") }}
16+
scmid: default
17+
actionid: default
18+
# {{ end }}
19+
20+
crawlers:
21+
github/action:
22+
{{ .spec | toYaml | indent 6 }}
23+
24+
{{ if or (.scm.enabled) (env "GITHUB_REPOSITORY") }}
25+
scms:
26+
default:
27+
kind: "github"
28+
spec:
29+
# Priority set to the environment variable
30+
user: '{{ default $GitHubUser .scm.user }}'
31+
# {{ if .scm.email }}
32+
email: '{{ .scm.email }}'
33+
# {{ end }}
34+
owner: '{{ default $GitHubRepositoryList._0 .scm.owner }}'
35+
repository: '{{ default $GitHubRepositoryList._1 .scm.repository }}'
36+
token: '{{ default $GitHubPAT .scm.token }}'
37+
username: '{{ default $GitHubUsername .scm.username }}'
38+
branch: '{{ .scm.branch }}'
39+
#{{ if .scm.commitusingapi }}
40+
commitusingapi: {{ .scm.commitusingapi }}
41+
# {{ end }}
42+
43+
actions:
44+
default:
45+
kind: "github/pullrequest"
46+
scmid: "default"
47+
spec:
48+
automerge: {{ .automerge }}
49+
# {{ if .labels }}
50+
labels:
51+
# {{ range .labels }}
52+
- {{ . }}
53+
# {{ end }}
54+
# {{ end }}
55+
{{ end }}
56+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "deps(github/action): bump all dependencies"
2+
#pipelineid: github/action/autodiscovery
3+
automerge: false
4+
labels:
5+
- dependencies
6+
7+
scm:
8+
enabled: false
9+
user: updatecli-bot
10+
#email: updatecli-bot@updatecli.io
11+
#owner: updatecli
12+
#repository: "repository"
13+
#token: "xxx"
14+
username: "updatecli"
15+
branch: main
16+
# commitusingapi: false
17+
18+
# spec:
19+
groupby: all
20+

0 commit comments

Comments
 (0)