Skip to content

Conversation

evan-cz
Copy link
Contributor

@evan-cz evan-cz commented Jun 5, 2025

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:

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

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.

Comment on lines +10 to +35
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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

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.


Suggested changeset 1
.github/workflows/renovate.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml
--- a/.github/workflows/renovate.yml
+++ b/.github/workflows/renovate.yml
@@ -1,2 +1,4 @@
 name: Renovate
+permissions:
+  contents: read
 
EOF
@@ -1,2 +1,4 @@
name: Renovate
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant