From b82fbfefa70addd179f1525b88067022338df89d Mon Sep 17 00:00:00 2001 From: Rosa Hase <1872366+daxcore@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:16:50 +0200 Subject: [PATCH] Added DEFAULT_FEEDS to replace default feeds URL e.g. if a newer tag or branch is needed some some reasons Signed-off-by: Rosa Hase <1872366+daxcore@users.noreply.github.com> --- README.md | 1 + action.yml | 1 + entrypoint.sh | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/README.md b/README.md index aeb6afb..3aebfbd 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ The action reads a few env variables: * `KEY_BUILD` can be a private Signify/`usign` key to sign the packages (ipk) feed. * `PRIVATE_KEY` can be a private key to sign the packages (apk) feed. * `NO_DEFAULT_FEEDS` disable adding the default SDK feeds +* `DEFAULT_FEEDS` relpace default feeds if `NO_DEFAULT_FEEDS` is disabled, where `|` are replaced by white spaces. * `NO_REFRESH_CHECK` disable check if patches need a refresh. * `NO_SHFMT_CHECK` disable check if init files are formated * `PACKAGES` (Optional) specify the list of packages (space separated) to be built diff --git a/action.yml b/action.yml index 466183a..a2bd9a4 100644 --- a/action.yml +++ b/action.yml @@ -43,6 +43,7 @@ runs: --env KEY_BUILD \ --env PRIVATE_KEY \ --env NO_DEFAULT_FEEDS \ + --env DEFAULT_FEEDS \ --env NO_REFRESH_CHECK \ --env NO_SHFMT_CHECK \ --env PACKAGES \ diff --git a/entrypoint.sh b/entrypoint.sh index 9e25b3c..a7347d6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -46,6 +46,14 @@ if [ -z "$NO_DEFAULT_FEEDS" ]; then -e 's,https://git.openwrt.org/openwrt/,https://github.com/openwrt/,' \ -e 's,https://git.openwrt.org/project/,https://github.com/openwrt/,' \ feeds.conf.default > feeds.conf + + # Replace complete feed URL when feed name matches (feedname|url^commit format) + for DEFAULT_FEED in $DEFAULT_FEEDS; do + feed_name=$(echo "$DEFAULT_FEED" | cut -d'|' -f1) + feed_url=$(echo "$DEFAULT_FEED" | cut -d'|' -f2) + [ -n "$feed_name" ] && [ -n "$feed_url" ] || continue + sed -i "s#^\(\([^[:space:]]\+\)[[:space:]]\+\)\(${feed_name}[[:space:]]\+\)\([^[:space:]]\+\)\$#\1\3${feed_url}#" feeds.conf + done fi echo "src-link $FEEDNAME /feed/" >> feeds.conf