-
Notifications
You must be signed in to change notification settings - Fork 8
CP-28568: add Renovate GitHub Action #272
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
base: develop
Are you sure you want to change the base?
Conversation
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Self-hosted Renovate | ||
uses: renovatebot/[email protected] | ||
env: | ||
LOG_LEVEL: debug | ||
with: | ||
# The entrypoint script is used to install some dependencies for our | ||
# postUpgradeTasks, and shouldn't be necessary for repositories which | ||
# don't require such custom tasks. | ||
docker-cmd-file: .github/renovate/entrypoint.sh | ||
# So we can use apt to install stuff. Then we run renovate as 'ubuntu' | ||
# in the entrypoint script. | ||
docker-user: root | ||
# Self-Hosted Configuration File | ||
# | ||
# This is where options that are only available in the self-hosted | ||
# version go; most things can/should go in a normal configuration | ||
# file. For details, see: | ||
# | ||
# https://docs.renovatebot.com/self-hosted-configuration/ | ||
# https://docs.renovatebot.com/configuration-options/ | ||
configurationFile: .github/renovate/global-config.json | ||
token: ${{ secrets.RENOVATE_TOKEN }} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 months ago
To fix the issue, we will add a permissions
block at the workflow level to explicitly define the minimal permissions required. Since the Renovate workflow primarily interacts with repository contents, we will set contents: read
. This ensures that the GITHUB_TOKEN
has only the necessary permissions to perform its tasks, reducing the risk of unintended actions.
The permissions
block will be added at the root level of the workflow, just below the name
field, so it applies to all jobs in the workflow.
-
Copy modified lines R2-R3
@@ -1,2 +1,4 @@ | ||
name: Renovate | ||
permissions: | ||
contents: read | ||
|
Renovate is a bit like Dependabot, but it tends to be more configurable (though less easy to use) and doesn't integrate as quite as well with GitHub (perhaps related to the fact that Dependabot is owned by GitHub). Renovate provides us with a few notable advantages: * It supports updating images in Helm charts, unlike Dependabot * It can run commands after an update (i.e., `make generate`) * As a GitHub action, we can trigger it manually, e.g. before a release, instead of waiting for it to run on its own.
Why Draft?
Waiting for a GitHub App to be configured for us to use. Once that's done, I'll need to tweak the action a bit (see https://github.com/renovatebot/github-action?tab=readme-ov-file#example-with-github-app), then hopefully it will work.
Why?
Renovate is a bit like Dependabot, but it tends to be more configurable (though less easy to use) and doesn't integrate as quite as well with GitHub (perhaps related to the fact that Dependabot is owned by GitHub).
Renovate provides us with a few notable advantages:
make generate
)What
Adds a GitHub Action for Renovate which will open PRs for out-of-date dependencies in the Helm chart.
How Tested
https://github.com/evan-cz/cloudzero-agent
Push to develop, manually run the action. Change the PR titles (so subsequent runs aren't detected as dupes), close the PRs, delete the corresponding branches. Repeat. Many, many times.