-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Auto-update composite actions automatically (#5248)
- Loading branch information
1 parent
32c94c9
commit 93e9696
Showing
3 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# This script ensures that we get all the directories that contain an "action.yaml" composite action | ||
# and make sure that we have a dependabot entry for them. Currently, dependabot doesn't support wildcarding | ||
# composite actions in a way that enables us to set a single entry for them. Instead, you need to grab all directories | ||
# that contain actions that you want to auto-update and add an entry for each one in "dependabot.yaml" | ||
# https://github.com/dependabot/dependabot-core/issues/6704 | ||
|
||
DIRS=($(find .github/actions -name "action.yaml" -type f -print0 | xargs -0 dirname | sort)) | ||
i=3 # Set the index to the starting index after all of the manually configured dependabot entries | ||
for DIR in "${DIRS[@]}"; do | ||
i=$i dir=$DIR yq -i '.updates[env(i)] = {"package-ecosystem": "github-actions", "directory": env(dir), "schedule": {"interval": "weekly"}, "groups": {"action-deps": {"patterns": ["*"]}}}' .github/dependabot.yaml | ||
i=$((i+1)) | ||
done |