-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (80 loc) · 2.98 KB
/
_renovate.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
workflow_call:
inputs:
renovate_actor:
default: "mazi-renovate[bot]"
required: false
type: string
repoCache:
description: "Reset or disable the cache?"
default: "enabled"
required: false
type: string
dependencyDashboardTitle:
default: "Dependency Dashboard"
required: false
type: string
rebaseLabel:
default: "rebase"
required: false
type: string
stopUpdatingLabel:
default: "stop-updating"
required: false
type: string
secrets:
app-id:
required: true
private-key:
required: true
permissions: {}
env:
RENOVATE_REPOSITORY_OWNER: 4m-mazi
RENOVATE_REPOSITORY_NAME: gh-test
jobs:
trigger-renovate:
if: >-
${{
contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
|| (
github.actor != inputs.renovate_actor
&& (
(github.event.issue.title == inputs.dependencyDashboardTitle && github.event.issue.user.login == inputs.renovate_actor)
|| (
github.event.pull_request.user.login == inputs.renovate_actor
&& github.event.pull_request.merged == false
&& (
(github.event.action == 'labeled' && github.event.label.name == inputs.rebaseLabel)
|| (github.event.action == 'unlabeled' && github.event.label.name == inputs.stopUpdatingLabel)
|| contains(fromJSON('["edited", "closed", "synchronize"]'), github.event.action)
)
)
)
)
}}
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
with:
# [permissions]─────────────────────────────────────
# [read and write]
# repo: Contents
# ──────────────────────────────────────────────────
app-id: ${{ secrets.app-id }}
private-key: ${{ secrets.private-key }}
owner: ${{ env.RENOVATE_REPOSITORY_OWNER }}
repositories: ${{ env.RENOVATE_REPOSITORY_NAME }}
- name: "Create a repository dispatch event"
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
RENOVATE_REPO: ${{ env.RENOVATE_REPOSITORY_OWNER }}/${{ env.RENOVATE_REPOSITORY_NAME }}
CACHE: ${{ inputs.repoCache }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$RENOVATE_REPO/dispatches \
-f "event_type=renovate" -F "client_payload[repoCache]=$CACHE"