Skip to content

Commit

Permalink
chore: add dependabot config (#134)
Browse files Browse the repository at this point in the history
* chore: add dependabot config

* disable auto updates for otel-elated dependencies

* simpllify config

* fix root dir
  • Loading branch information
Elfo404 authored Sep 19, 2024
1 parent 82c9fa4 commit 7c409c6
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# File generated by "make gendependabot"; DO NOT EDIT.
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directories:
- "/"
- "/internal/semconv"
- "/internal/sharedcomponent"
- "/internal/tools"
- "/internal/traceutils"
- "/receiver/dronereceiver"
- "/receiver/githubactionsreceiver"
schedule:
interval: "weekly"
ignore:
# OpenTelemetry updates will be done manually
- dependency-name: "github.com/open-telemetry/opentelemetry-collector*"
- dependency-name: "go.opentelemetry.io/*"
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ jobs:
make fmt-all
git diff -s --exit-code || (echo 'Code is not formatted. Run make fmt-all and commit the changes' && git --no-pager diff && exit 1)
- name: Check dependabot config
run: |
make gendependabot
git diff -s --exit-code || (echo 'Dependabot config is out of date. Run make gendependabot and commit the changes' && git --no-pager diff && exit 1)
- name: Make lint-all
run: make lint-all

Expand Down
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,39 @@ checks: install-tools
crosslink:
$(CROSSLINK) --root=$(shell pwd) --prune

DEPENDABOT_PATH=".github/dependabot.yml"
DEPENDABOT_UPDATE_FREQUENCY="weekly"
.PHONY: gendependabot
gendependabot:
@echo "Recreate dependabot.yml file"
@echo "# File generated by \"make gendependabot\"; DO NOT EDIT." > ${DEPENDABOT_PATH}
@echo "version: 2" >> ${DEPENDABOT_PATH}
@echo "updates:" >> ${DEPENDABOT_PATH}

@echo "Add entry for \"/\" (github-actions)"
@echo " - package-ecosystem: \"github-actions\"" >> ${DEPENDABOT_PATH}
@echo " directory: \"/\"" >> ${DEPENDABOT_PATH}
@echo " schedule:" >> ${DEPENDABOT_PATH}
@echo " interval: \"${DEPENDABOT_UPDATE_FREQUENCY}\"" >> ${DEPENDABOT_PATH}

@echo "Add entry for \"/\" (docker)"
@echo " - package-ecosystem: \"docker\"" >> ${DEPENDABOT_PATH}
@echo " directory: \"/\"" >> ${DEPENDABOT_PATH}
@echo " schedule:" >> ${DEPENDABOT_PATH}
@echo " interval: \"${DEPENDABOT_UPDATE_FREQUENCY}\"" >> ${DEPENDABOT_PATH}

@echo "Add entry for package dirs (gomod) with entries:";
@echo " - package-ecosystem: \"gomod\"" >> ${DEPENDABOT_PATH};
@echo " directories:" >> ${DEPENDABOT_PATH};
@echo " "- /""
@echo " "- \"/\""" >> ${DEPENDABOT_PATH}
@set -e; for dir in $(PKG_DIRS); do \
echo " - $${dir:1}"; \
echo " - \"$${dir:1}\"" >> ${DEPENDABOT_PATH}; \
done;
@echo " schedule:" >> ${DEPENDABOT_PATH}
@echo " interval: \"${DEPENDABOT_UPDATE_FREQUENCY}\"" >> ${DEPENDABOT_PATH}
@echo " ignore:" >> ${DEPENDABOT_PATH}
@echo " # OpenTelemetry updates will be done manually" >> ${DEPENDABOT_PATH}
@echo " - dependency-name: \"github.com/open-telemetry/opentelemetry-collector*\"" >> ${DEPENDABOT_PATH}
@echo " - dependency-name: \"go.opentelemetry.io/*\"" >> ${DEPENDABOT_PATH}

0 comments on commit 7c409c6

Please sign in to comment.