Skip to content

Commit 411bb46

Browse files
committed
Add renovate preset to update the public reusable GitHub Workflow
1 parent 7f17377 commit 411bb46

6 files changed

+83
-1
lines changed

.github/workflows/internal-check-renovate-config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
# Only watch root level Renovate configuration changes
88
paths:
99
- 'renovate.json*'
10+
- 'renovate-presets/**'
1011
- '.github/workflows/internal-check-renovate-config.yml' # or when this file changed
1112

1213
jobs:

.github/workflows/internal-java-code-analysis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- '.gitignore'
1616
- '.gitattributes'
1717
- 'renovate.json'
18+
- 'renovate-presets/**'
1819
- 'changelogTemplate.mustache'
1920
- '**.code-workspace'
2021
- '.github/workflows/internal-typescript-code-analysis.yml'
@@ -33,6 +34,7 @@ on:
3334
- '.gitignore'
3435
- '.gitattributes'
3536
- 'renovate.json'
37+
- 'renovate-presets/**'
3638
- 'changelogTemplate.mustache'
3739
- '**.code-workspace'
3840
- '.github/workflows/internal-typescript-code-analysis.yml'

.github/workflows/internal-typescript-code-analysis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- '.gitignore'
1616
- '.gitattributes'
1717
- 'renovate.json'
18+
- 'renovate-presets/**'
1819
- 'changelogTemplate.mustache'
1920
- '**.code-workspace'
2021
- '.github/workflows/internal-java-code-analysis.yml'
@@ -33,6 +34,7 @@ on:
3334
- '.gitignore'
3435
- '.gitattributes'
3536
- 'renovate.json'
37+
- 'renovate-presets/**'
3638
- 'changelogTemplate.mustache'
3739
- '**.code-workspace'
3840
- '.github/workflows/internal-java-code-analysis.yml'

INTEGRATION.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document describes the steps to get started as quickly as possible.
44
:point_right: For more details on what else you can do see [README](./README.md).
55
:point_right: For more details on how to analyze your code locally see [GETTING_STARTED](./GETTING_STARTED.md).
66

7-
## :rocket: How to use it
7+
## :rocket: How to integrate it
88

99
This repository provides a reusable GitHub Actions Workflow to analyze code. The workflow is defined in [public-analyze-code-graph.yml](./.github/workflows/public-analyze-code-graph.yml).
1010

@@ -23,6 +23,10 @@ You can find examples in:
2323

2424
:warning: Note: Workflows with names starting with `internal-` are private and should not be used outside this repository. They may change at any time without notice.
2525

26+
## :repeat: How to update it with Renovate
27+
28+
This repository provides a Renovate presets to update the code graph analysis pipeline workflow. The presets are defined in the folder [renovate-presets](./renovate-presets). Example: [code-graph-analysis-workflow-latest-digest.json5](./renovate-presets/code-graph-analysis-workflow-latest-digest.json5). More details can be found in [renovate-presets/README.md](./renovate-presets/README.md).
29+
2630
## :gear: Parameters
2731

2832
The workflow parameters are as follows:

renovate-presets/README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Renovate Presets
2+
3+
This folder contains Renovate presets for updating the code graph analysis workflow. These presets are designed to be used in other repositories to streamline and automate dependency updates.
4+
5+
## Available Presets
6+
7+
### Code Graph Analysis Workflow
8+
9+
This preset is designed to update the dependencies and configurations related to the code graph analysis workflow.
10+
11+
## Usage
12+
13+
To use a preset from this folder in your repository, add the following to your `renovate.json` configuration:
14+
15+
```json
16+
{
17+
"extends": [
18+
"github>JohT/code-graph-analysis-pipeline//renovate-presets/<preset-name>.json5"
19+
]
20+
}
21+
```
22+
23+
Replace `<preset-name>` with the name of the preset you want to use, e.g., `code-graph-analysis-workflow-latest-digest`.
24+
25+
## Future Presets
26+
27+
In the future, more presets with different options may be added to this folder. These presets will also be publicly available for use in other repositories.
28+
29+
## References
30+
31+
- Available configuration options: https://docs.renovatebot.com/configuration-options
32+
- Shareable configuration presets: https://docs.renovatebot.com/config-presets
33+
- Update of GitHub Actions: https://docs.renovatebot.com/modules/manager/github-actions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// References:
2+
// - JSON5: https://json5.org
3+
// - Available configuration options: https://docs.renovatebot.com/configuration-options
4+
// - Shareable configuration presets: https://docs.renovatebot.com/config-presets
5+
// - Update of GitHub Actions: https://docs.renovatebot.com/modules/manager/github-actions
6+
{
7+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
8+
"description": "Keep the pinned code-graph-analysis-pipeline GitHub Workflow up-to-date with the latest digest (commit hash) of a specific branch or tag",
9+
"packageRules": [
10+
{
11+
// Keeps the GitHub Actions update of code-graph-analysis-pipeline and the update of its "ref" parameter value in sync.
12+
"description": "Code Graph Analysis Pipeline Workflow",
13+
"groupName": [
14+
"Code Graph Analysis Pipeline Workflow"
15+
],
16+
"matchPackageNames": [
17+
"JohT/code-graph-analysis-pipeline",
18+
"https://github.com/JohT/code-graph-analysis-pipeline"
19+
]
20+
}
21+
],
22+
"customManagers": [
23+
{
24+
"description": "Update code-graph-analysis-pipeline public shared workflow's ref parameter",
25+
"customType": "regex",
26+
"fileMatch": [
27+
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
28+
"(^|/)action\\.ya?ml$"
29+
],
30+
"matchStringsStrategy": "combination",
31+
"matchStrings": [
32+
"uses: JohT/code-graph-analysis-pipeline/\\.github/workflows/public-analyze-code-graph\\.yml*\\s*",
33+
"ref:\\s*(?<currentDigest>.*?)\\s+#\\s+(?<currentValue>.*?)\\s+"
34+
],
35+
36+
"packageNameTemplate": "https://github.com/JohT/code-graph-analysis-pipeline",
37+
"datasourceTemplate": "git-refs"
38+
}
39+
]
40+
}

0 commit comments

Comments
 (0)