Skip to content

Add renovate preset to update the public reusable GitHub Workflow #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/internal-check-renovate-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
# Only watch root level Renovate configuration changes
paths:
- 'renovate.json*'
- 'renovate-presets/**'
- '.github/workflows/internal-check-renovate-config.yml' # or when this file changed

jobs:
Expand All @@ -20,6 +21,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Get the list of all renovate presets and the main renovate configuration
id: set-renovate-config-files
run: |
echo "RENOVATE_CONFIG_FILES=$(find renovate-presets -type f -name '*.json' -o -name '*.json5') renovate.json" >> $GITHUB_ENV

- name: Run renovate-config-validator
run: npx --yes --package [email protected] -- renovate-config-validator
run: npx --yes --package [email protected] -- renovate-config-validator ${{ env.RENOVATE_CONFIG_FILES }}
2 changes: 2 additions & 0 deletions .github/workflows/internal-java-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- '.gitignore'
- '.gitattributes'
- 'renovate.json'
- 'renovate-presets/**'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/internal-typescript-code-analysis.yml'
Expand All @@ -33,6 +34,7 @@ on:
- '.gitignore'
- '.gitattributes'
- 'renovate.json'
- 'renovate-presets/**'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/internal-typescript-code-analysis.yml'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/internal-typescript-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- '.gitignore'
- '.gitattributes'
- 'renovate.json'
- 'renovate-presets/**'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/internal-java-code-analysis.yml'
Expand All @@ -33,6 +34,7 @@ on:
- '.gitignore'
- '.gitattributes'
- 'renovate.json'
- 'renovate-presets/**'
- 'changelogTemplate.mustache'
- '**.code-workspace'
- '.github/workflows/internal-java-code-analysis.yml'
Expand Down
6 changes: 5 additions & 1 deletion INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document describes the steps to get started as quickly as possible.
:point_right: For more details on what else you can do see [README](./README.md).
:point_right: For more details on how to analyze your code locally see [GETTING_STARTED](./GETTING_STARTED.md).

## :rocket: How to use it
## :rocket: How to integrate it

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).

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

: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.

## :repeat: How to update it with Renovate

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).

## :gear: Parameters

The workflow parameters are as follows:
Expand Down
33 changes: 33 additions & 0 deletions renovate-presets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Renovate Presets

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.

## Available Presets

### Code Graph Analysis Workflow

This preset is designed to update the dependencies and configurations related to the code graph analysis workflow.

## Usage

To use a preset from this folder in your repository, add the following to your `renovate.json` configuration:

```json
{
"extends": [
"github>JohT/code-graph-analysis-pipeline//renovate-presets/<preset-name>.json5"
]
}
```

Replace `<preset-name>` with the name of the preset you want to use, e.g., `code-graph-analysis-workflow-latest-digest`.

## Future Presets

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.

## References

- Available configuration options: https://docs.renovatebot.com/configuration-options
- Shareable configuration presets: https://docs.renovatebot.com/config-presets
- Update of GitHub Actions: https://docs.renovatebot.com/modules/manager/github-actions
37 changes: 37 additions & 0 deletions renovate-presets/code-graph-analysis-workflow-latest-digest.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// References:
// - JSON5: https://json5.org
// - Available configuration options: https://docs.renovatebot.com/configuration-options
// - Shareable configuration presets: https://docs.renovatebot.com/config-presets
// - Update of GitHub Actions: https://docs.renovatebot.com/modules/manager/github-actions
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"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",
"packageRules": [
{
// Keeps the GitHub Actions update of code-graph-analysis-pipeline and the update of its "ref" parameter value in sync.
"description": "Code Graph Analysis Pipeline Workflow",
"groupName": "Code Graph Analysis Pipeline Workflow",
"matchPackageNames": [
"JohT/code-graph-analysis-pipeline",
"https://github.com/JohT/code-graph-analysis-pipeline"
]
}
],
"customManagers": [
{
"description": "Update code-graph-analysis-pipeline public shared workflow's ref parameter",
"customType": "regex",
"fileMatch": [
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
"(^|/)action\\.ya?ml$"
],
"matchStringsStrategy": "combination",
"matchStrings": [
"uses: JohT/code-graph-analysis-pipeline/\\.github/workflows/public-analyze-code-graph\\.yml*\\s*",
"ref:\\s*(?<currentDigest>.*?)\\s+#\\s+(?<currentValue>.*?)\\s+"
],
"packageNameTemplate": "https://github.com/JohT/code-graph-analysis-pipeline",
"datasourceTemplate": "git-refs"
}
]
}
Loading