7 Commits

Author SHA1 Message Date
Alexandre
79f0d71d30 Merge pull request #2265 from alexbelgium/codex/fix-addon-updater-for-codeberg
Add Codeberg API fallback
2025-12-08 15:17:28 +01:00
Alexandre
d1442c607a Add Codeberg API fallback 2025-12-08 15:17:04 +01:00
github-actions
ff6ca99195 GitHub bot: changelog 2025-12-08 09:31:23 +00:00
Alexandre
48d5152586 Merge pull request #2264 from alexbelgium/codex/update-addons-updater-for-codeberg-support
Clarify Codeberg arguments for addons updater
2025-12-08 10:28:08 +01:00
Alexandre
5c378d2e1d Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-08 10:27:14 +01:00
Alexandre
1ce6f810d5 Update CHANGELOG.md 2025-12-08 10:25:38 +01:00
Alexandre
a9475b9a2e Clarify Codeberg arguments and bump version 2025-12-08 05:25:23 +01:00
4 changed files with 50 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
## description: Automatic addons update by aligning version tag with upstream releases 3.19.15 (08-12-2025)
- The Home Assistant project has deprecated support for the armv7, armhf and i386 architectures. Support wil be fully dropped in the upcoming Home Assistant 2025.12 release
- Improve Codeberg handling with a Gitea API fallback when lastversion lacks custom host support
## 3.19.12 (18-11-2025)

View File

@@ -66,7 +66,7 @@ You can add the following tags in the file :
- repository: 'name/repo' coming from github
- paused: true # Pauses the updates
- slug: the slug name from your addon
- source: dockerhub/github,gitlab,bitbucket,pip,hg,sf,website-feed,local,helm_chart,wiki,system,wp
- source: dockerhub/github,gitlab,bitbucket,pip,hg,sf,website-feed,local,helm_chart,wiki,system,wp,codeberg (Codeberg is supported via its Gitea API, which is configured automatically)
- upstream_repo: name/repo, example is 'linuxserver/docker-emby'
- upstream_version: automatically populated, corresponds to the current upstream version referenced in the addon
- dockerhub_by_date: in dockerhub, uses the last_update date instead of the version

View File

@@ -28,4 +28,4 @@ schema:
slug: updater
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/addons_updater
version: "3.19.12"
version: "3.19.15"

View File

@@ -170,7 +170,17 @@ for f in */; do
# Use source as upstream
ARGUMENTS="--at $SOURCE"
LOGINFO="... $SLUG : source is $SOURCE" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
LASTVERSION_REPO="$UPSTREAM"
if [ "${SOURCE}" = "codeberg" ]; then
# Codeberg is a hosted Gitea instance; pass the repository as a full URL for lastversion
CODEBERG_BASE_URL="https://codeberg.org"
ARGUMENTS="--at gitea"
LASTVERSION_REPO="${CODEBERG_BASE_URL}/${UPSTREAM}"
LOGINFO="... $SLUG : source is codeberg (gitea, using ${CODEBERG_BASE_URL})" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
else
LOGINFO="... $SLUG : source is $SOURCE" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
fi
#Prepare tag flag
if [ "${FULLTAG}" = true ]; then
@@ -254,7 +264,40 @@ for f in */; do
}
# shellcheck disable=SC2086
LASTVERSION="$(lastversion "$UPSTREAM" $ARGUMENTS || test_packages)"
LASTVERSION="$(lastversion "$LASTVERSION_REPO" $ARGUMENTS || test_packages)"
# Codeberg fallback: lastversion may not support custom Gitea hosts in older builds
if [[ -z "$LASTVERSION" && "${SOURCE}" = "codeberg" ]]; then
LOGINFO="... $SLUG : attempting Codeberg API fallback" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
RELEASES_URL="https://codeberg.org/api/v1/repos/${UPSTREAM}/releases"
JQ_FILTER='.[] | select(.draft == false)'
if [ "$BETA" != true ]; then
JQ_FILTER='.[] | select(.draft == false and .prerelease == false)'
fi
CODEBERG_TAGS=$(curl -fsSL "$RELEASES_URL" | jq -r "$JQ_FILTER | .tag_name" || true)
if [ -n "$CODEBERG_TAGS" ]; then
if [ -n "$FILTER_TEXT" ]; then
CODEBERG_TAGS=$(echo "$CODEBERG_TAGS" | grep "$FILTER_TEXT" || true)
fi
if [ -n "$EXCLUDE_TEXT" ]; then
CODEBERG_TAGS=$(echo "$CODEBERG_TAGS" | sed "/${EXCLUDE_TEXT}/d")
fi
CODEBERG_TAGS=$(echo "$CODEBERG_TAGS" | sed '/^$/d' | sort -V)
LASTVERSION=$(echo "$CODEBERG_TAGS" | tail -n 1)
fi
if [ -n "$LASTVERSION" ] && [ "$FULLTAG" != true ]; then
LASTVERSION="${LASTVERSION#v}"
fi
if [ -z "$LASTVERSION" ]; then
bashio::log.warning "... $SLUG : unable to determine Codeberg release"
set_continue=true
fi
fi
# Continue if issue
if [[ "${set_continue:-false}" == true ]]; then