-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (46 loc) · 1.78 KB
/
generate-renovate-config.yaml
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
name: Convert Template to JSON
# No possibility to use on.workflow_run.workflows[Common issues check] inside PR
# because GHA sucks - https://github.com/orgs/community/discussions/25220\
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'default.template.json5'
jobs:
generate-renovate-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Update default.json
id: update_json
run: |
sed 's|\s* //.*||g' default.template.json5 \
| sed -e '/^$/d' \
| sed -e 's/^{$/{\n "description": "THIS FILE IS GENERATED FROM default.template.json5",/' \
> default.json
# # Alternative solution, 3-times longer but without sed
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# - run: cargo install json5-to-json
# - name: Generate default.json
# id: generate_json
# run: |
# cat default.template.json5 | json5-to-json > default.json
- name: Push fixes
uses: EndBug/add-and-commit@61a88be553afe4206585b31aa72387c64295d08b # v9.1.1
with:
# Determines the way the action fills missing author name and email. Three options are available:
# - github_actor -> UserName <UserName@users.noreply.github.com>
# - user_info -> Your Display Name <your-actual@email.com>
# - github_actions -> github-actions <email associated with the github logo>
# Default: github_actor
default_author: github_actor
# The message for the commit.
# Default: 'Commit from GitHub Actions (name of the workflow)'
message: 'chore: Regenerate default.json'