From da18756460414e3c52a1ee99434c24fb809663aa Mon Sep 17 00:00:00 2001 From: pazpi Date: Thu, 4 Dec 2025 22:57:49 +0100 Subject: [PATCH] fix action 3 --- .forgejo/workflows/auto-update.yaml | 35 +++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/auto-update.yaml b/.forgejo/workflows/auto-update.yaml index f5e6f3d..855ac95 100644 --- a/.forgejo/workflows/auto-update.yaml +++ b/.forgejo/workflows/auto-update.yaml @@ -29,10 +29,19 @@ jobs: - name: Check for changes id: changes run: | + echo "DEBUG: GITHUB_OUTPUT='${GITHUB_OUTPUT:-}'" + echo "DEBUG: Checking if GITHUB_OUTPUT var is set: $(if [ -z "${GITHUB_OUTPUT+x}" ]; then echo "NOT SET"; else echo "SET (value: '$GITHUB_OUTPUT')"; fi)" + + set_output() { + echo "::set-output name=$1::$2" + if [ -n "${GITHUB_OUTPUT:-}" ]; then + echo "$1=$2" >> "$GITHUB_OUTPUT" + fi + } if git diff --quiet flake.lock; then - echo "changed=false" >> $GITHUB_OUTPUT + set_output changed false else - echo "changed=true" >> $GITHUB_OUTPUT + set_output changed true fi - name: Extract LXC hosts @@ -40,6 +49,14 @@ jobs: if: steps.changes.outputs.changed == 'true' run: | set -euo pipefail + + set_output() { + echo "::set-output name=$1::$2" + if [ -n "${GITHUB_OUTPUT:-}" ]; then + echo "$1=$2" >> "$GITHUB_OUTPUT" + fi + } + HOSTS=$(nix eval --json .#colmena --apply 'x: builtins.filter (n: n != "meta" && builtins.elem "lxc" (x.${n}.deployment.tags or [])) (builtins.attrNames x)' 2>&1) || { echo "Failed to evaluate colmena hosts" exit 1 @@ -47,16 +64,20 @@ jobs: # Validate the output is a non-empty JSON array if ! echo "$HOSTS" | jq -e '. | if type == "array" and length > 0 then true else false end' > /dev/null 2>&1; then echo "Error: No LXC hosts found or invalid JSON output: $HOSTS" - echo "hosts=[]" >> $GITHUB_OUTPUT + set_output hosts "[]" exit 0 fi - echo "hosts=$HOSTS" >> $GITHUB_OUTPUT + + set_output hosts "$HOSTS" echo "Discovered hosts: $HOSTS" # Also write to file as backup (in case job outputs don't work) echo "$HOSTS" > hosts.json - # Verify output was set - echo "DEBUG: GITHUB_OUTPUT contents:" - cat $GITHUB_OUTPUT + # Debug output + echo "DEBUG: GITHUB_OUTPUT exists: ${GITHUB_OUTPUT:-NOT SET}" + if [ -n "${GITHUB_OUTPUT:-}" ] && [ -f "$GITHUB_OUTPUT" ]; then + echo "DEBUG: GITHUB_OUTPUT contents:" + cat "$GITHUB_OUTPUT" + fi - name: Debug job outputs if: steps.changes.outputs.changed == 'true'