Files
hassio-addons/.github/workflows/on_issues.yml
Alexandre bb1d0c6b66 ci: pin EndBug/add-and-commit to v11.0.0, the floating v11 tag is broken (#2996)
Every push to master has failed to build since 2026-08-19 05:15. The
prebuild-sanitize job dies before running a single step:

    EndBug/add-and-commit/v11/action.yml (Line: 25, Col: 18):
    Unrecognized named-value: 'github'. Located at position 1 within
    expression: github.workspace
    Failed to load EndBug/add-and-commit/v11/action.yml

Upstream's v11.1.0, published 2026-08-18 22:44 UTC, put a literal
"${{ github.workspace }}" inside the description of the `cwd` input. Action
metadata descriptions are still parsed as expressions and the `github` context
does not exist there, so the action no longer loads at all. The floating v11
tag was moved to it, which is why nothing changed in this repo and every
workflow using the action broke at once - the builder, the README and stats
refreshers, the CRLF sweep, the image compressor and the issue labeller.

v11.0.0 does not contain that line and loads normally, so pinning to it keeps
the version Dependabot moved us to in #2985 while stepping off the tag. It also
took out an unrelated add-on fix: the builder's revert-on-failure job reverted
the seerr merge (#2993) as collateral, and that is being reapplied separately.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 07:29:52 +02:00

70 lines
2.8 KiB
YAML

# yamllint disable rule:line-length
---
name: Readme Issues linker
on:
issues:
types: [opened, edited, closed]
workflow_dispatch:
jobs:
ISSUES_linked:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v7.0.1
- name: Assign issues
run: |
# Init
echo "Starting"
# Get issues list
curl -s -L https://api.github.com/repos/alexbelgium/hassio-addons/issues > issueslist
# Go through all folders, add to filters if not existing
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
if [ -f "$f"/config.json ] && [ -f "$f"/README.md ]; then
# Clean previously reported issues
sed -i "/Open Issue :/d" "$f"/README.md
sed -i "/Open Request :/d" "$f"/README.md
# If there is an issue with the addon name in title, put a message
COUNTER=0
while [[ $(jq -r --arg COUNTER "$COUNTER" ".[$COUNTER].title" issueslist) != null ]]; do
#Increment counter
(( COUNTER=COUNTER+1 )) || true
#Get variables
TITLE="$(jq -r --arg COUNTER "$COUNTER" ".[$COUNTER].title" issueslist)"
TITLE="${TITLE//[<>\$\'\"]/}"
#Check if relevant to addon
SLUG="$(jq -r --arg f "$f" ".slug" "$f"/config.json)"
NAME="$(jq -r --arg f "$f" ".name" "$f"/config.json)"
if [[ "${TITLE,,}" == *"${f,,}"* ]] || [[ "${TITLE,,}" == *"${SLUG,,}"* ]] || [[ "${TITLE,,}" == *"${NAME,,}"* ]]; then
echo "Project $TITLE, $SLUG, $NAME has an issue"
REQ="$(jq -r --arg COUNTER "$COUNTER" ".[$COUNTER].user.login" issueslist)"
URL="$(jq -r --arg COUNTER "$COUNTER" ".[$COUNTER].html_url" issueslist)"
LABEL="$(jq -r --arg COUNTER "$COUNTER" ".[$COUNTER].labels[].name" issueslist)"
DATEISSUE="$(jq -r --arg COUNTER "$COUNTER" ".[$COUNTER].created_at" issueslist)"
DATEISSUE="${DATEISSUE%T*}"
if [[ "$LABEL" == *"bug"* ]]; then
sed -i "1i ## &#9888; Open Issue : [$TITLE (opened ${DATEISSUE})]($URL) by [@${REQ}](https://github.com/$REQ)" "$f"/README.md
elif [[ "$LABEL" == *"enhancement"* ]]; then
sed -i "1i ## &#9888; Open Request : [$TITLE (opened ${DATEISSUE})]($URL) by [@${REQ}](https://github.com/$REQ)" "$f"/README.md
fi
fi
done
fi
done
# Remove issues list
rm issueslist
- name: Commit if needed
uses: EndBug/add-and-commit@v11.0.0
with:
message: "Github bot : issues linked to readme"
default_author: github_actions
commit: -u
fetch: --force
push: --force