Skip to content

Commit

Permalink
AAE-18008: Make dependabot update actions (#344)
Browse files Browse the repository at this point in the history
Co-authored-by: Giovanni Toraldo <[email protected]>
  • Loading branch information
atchertchian and gionn authored Nov 14, 2023
1 parent b37a1c6 commit 6d20cc2
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# Edit should be made in the dependabot.template.yml
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
directory: "/.github/actions/pipenv"
schedule:
interval: "monthly"
252 changes: 250 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,261 @@
# Documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# Edit should be made in the dependabot.template.yml
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

interval: "weekly"
- package-ecosystem: "pip"
directory: "/.github/actions/pipenv"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/automate-dependabot"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/automate-propagation"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/calculate-next-internal-version"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/configure-git-author"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/dbp-charts"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/docker-build-image"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/docker-dump-containers-logs"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/docker-scan-image-dirs"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/env-load-from-yaml"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/free-hosted-runner-disk-space"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/get-branch-name"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/get-build-info"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/get-commit-message"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/git-check-existing-tag"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/git-commit-changes"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/git-latest-tag"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-build-chart"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-integration-tests"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-package-chart"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-parse-next-release"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-plugin"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-publish-chart"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-release-and-publish"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-template-yamllint"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/helm-update-chart-version"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/jx-updatebot-pr"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/kubectl-keep-nslogs"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/load-release-descriptor"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/maven-build-and-tag"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/maven-deploy-file"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/maven-release"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/maven-update-pom-version"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/nexus-close-staging"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/nexus-create-staging"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/nexus-release-staging"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/pipenv"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/pre-commit"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/pre-commit-default"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/process-coverage-report"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/rancher"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/reportportal-prepare"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/reportportal-summarize"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/resolve-preview-name"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/send-slack-notification"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/send-slack-notification-slow-job"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/send-teams-notification"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-github-release-binary"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-helm-docs"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-java-build"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-jx-release-version"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-kcadm"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-kind"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-kubepug"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-pysemver"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-rancher-cli"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-terraform-docs"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-updatebot"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/update-deployment-runtime-versions"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/update-pom-to-next-pre-release"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/update-project-base-tag"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/validate-maven-versions"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/.github/actions/veracode"
schedule:
interval: "weekly"
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ repos:
rev: v0.32.2
hooks:
- id: markdownlint
- repo: local
hooks:
- id: generate-dependabot
name: Generate dependabot config for actions
language: system
entry: ./update-dependabot.sh
pass_filenames: false
43 changes: 43 additions & 0 deletions update-dependabot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Directory containing composite actions
actions_dir='.github/actions'

# Dependabot source config file
master_config='.github/dependabot.template.yml'

# Dependabot target config file
dependabot_config='.github/dependabot.yml'

# Temp file for new Dependabot config section
temp_config='temp_dependabot.yml'

# Function to generate Dependabot config section for a composite action
generate_dependabot_section() {
local action_dir=$1
echo " - package-ecosystem: \"github-actions\""
echo " directory: \"/${action_dir}\""
echo " schedule:"
echo " interval: \"weekly\""
}

# Check if Dependabot config exists
if [ ! -f "$master_config" ]; then
echo "$master_config config not found."
exit 1
fi

# Start building the new config section
echo "version: 2" > "$temp_config"
echo "updates:" >> "$temp_config"

# Loop through composite actions and append to temp config
for action_dir in $(find "$actions_dir" -mindepth 1 -maxdepth 1 -type d | sort -n); do
generate_dependabot_section "$action_dir" >> "$temp_config"
done

# Merge new section with existing Dependabot config using yq
yq eval-all '. as $item ireduce ({}; . *+ $item)' $master_config $temp_config > "$dependabot_config"

# Clean up
rm "$temp_config"

0 comments on commit 6d20cc2

Please sign in to comment.