-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore: add dependabot-sync
action
#191
Conversation
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
time: "05:00" | ||
timezone: "America/New_York" | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "feat" | ||
include: "scope" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed some repositories that do not have a Dockerfile included a config to keep Docker up-to-date (the file was probably just copy-and-pasted at the time). This means that this is a no-op action if a Dockerfile is not available.
I decided to use it in our favor and have it by default, even if many repos do not have Dockerfiles. This allows us to have less specific config files as the base work for more repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just keep one dependabot.yml
file and consolidate all of them, wdyt @andreynering ?
@aymanbagabas Some repos really have different rules. For example, an additional |
Another thing... the |
59c77dd
to
0f0c579
Compare
DEPENDABOT_FILE="${{ github.repository_owner }}/meta/dependabot/dependabot-${{ github.event.repository.name }}.yml" | ||
if [ ! -f $DEPENDABOT_FILE ]; then | ||
DEPENDABOT_FILE="${{ github.repository_owner }}/meta/dependabot/dependabot.yml" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep files short and concise, we can have the repository specific settings stored in dependabot-repo.yml
, then they get concatenated here. wdyt?
DEPENDABOT_FILE="${{ github.repository_owner }}/meta/dependabot/dependabot-${{ github.event.repository.name }}.yml" | |
if [ ! -f $DEPENDABOT_FILE ]; then | |
DEPENDABOT_FILE="${{ github.repository_owner }}/meta/dependabot/dependabot.yml" | |
fi | |
cat "${{ github.repository_owner }}/meta/dependabot/dependabot.yml" > "${{ github.repository }}/dependabot.yml" | |
DEPENDABOT_FILE="${{ github.repository_owner }}/meta/dependabot/dependabot-${{ github.event.repository.name }}.yml" | |
if [ -f "$DEPENDABOT_FILE" ]; then | |
cat "$DEPENDABOT_FILE" >> "${{ github.repository }}/dependabot.yml" | |
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There would be at least three exceptions. These repos don't have any Go code, so they have config for GHA and/or npm only.
dependabot/dependabot-nur.yml
dependabot/dependabot-vhs-action.yml
dependabot/dependabot-soft-serve-action.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, in that case, since they don't have a go.mod
file, dependabot will just skip that part, right? If so I think that's fine, especially if it will reduce the overhead and maintenance in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the step will skip if go.mod
is missing, but Okay, let's try that! We'll just need to adjust if it don't work as expected.
I'd say let's keep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -0,0 +1,45 @@ | |||
name: dependabot-sync | |||
on: | |||
workflow_call: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use inputs here so the caller sets the filename, then we don't need that shell script
example:
meta/.github/workflows/soft-serve.yml
Line 7 in 30584a8
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be cool to be able to call this workflow from the GitHub webUI, specify a repo, and run the workflow for it to do the work, copy the config and open a PR in the given repo. Same goes for lint-sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. That got me the idea that this workflow could also copy the actual workflow file to the repo, so I don't have to open manual PRs for each repo. 🙂
Similar to the existing
lint-sync
, this will be references on our repos and make it easier to manage Dependabot config from now on.