From ca117177348d780723dde25c7c936332368e63b5 Mon Sep 17 00:00:00 2001 From: SashaMIT Date: Wed, 5 Aug 2026 20:06:32 +0700 Subject: [PATCH 1/2] ci: bind docker/pypi workflow inputs via env before shell Pass platforms-to-build, docker hub owner/version/push-latest, and dist-location through env: before run: scripts (script-injection class). Co-authored-by: Cursor Changelog-None --- .github/workflows/docker-build.yml | 4 +++- .github/workflows/docker-publish.yml | 19 ++++++++++++++----- .github/workflows/pypi-publish.yml | 8 +++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 6b2479309cad..4727581f0184 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -23,8 +23,10 @@ jobs: platforms: ${{ steps.plan.outputs.platforms }} steps: - id: plan + env: + PLATFORMS_TO_BUILD: ${{ inputs.platforms-to-build }} run: | - IFS=',' read -ra ARR <<< "${{ inputs.platforms-to-build }}" + IFS=',' read -ra ARR <<< "$PLATFORMS_TO_BUILD" JSON=$(printf '%s\n' "${ARR[@]}" | jq -R . | jq -sc .) echo "platforms=$JSON" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 78bcaf64eefd..9aee3a2a186a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -43,25 +43,34 @@ jobs: merge-multiple: false - name: Set up values + env: + DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }} + PUSH_LATEST: ${{ inputs.push-latest }} + VERSION: ${{ inputs.version }} + REF_TYPE: ${{ github.ref_type }} run: | DIGEST_REFS="" for f in /tmp/digests/*/digest.txt; do D=$(cat "$f") - DIGEST_REFS="$DIGEST_REFS ${{ inputs.dh-repository-owner }}/lightningd@${D}" + DIGEST_REFS="$DIGEST_REFS ${DH_REPOSITORY_OWNER}/lightningd@${D}" done echo "DIGEST_REFS=$DIGEST_REFS" >> $GITHUB_ENV - if [[ "${{ inputs.push-latest }}" == "true" ]] || - ([[ "${{ github.ref_type }}" == "tag" ]] && [[ ! "${{ inputs.version }}" =~ rc ]]); then + if [[ "$PUSH_LATEST" == "true" ]] || + ([[ "$REF_TYPE" == "tag" ]] && [[ ! "$VERSION" =~ rc ]]); then echo "PUSHLATEST=true" >> $GITHUB_ENV else echo "PUSHLATEST=false" >> $GITHUB_ENV fi - name: Create and push real tag(s) + env: + DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }} + VERSION: ${{ inputs.version }} + TAG_SUFFIX: ${{ matrix.tag_suffix }} run: | - TAG_ARGS=(-t "${{ inputs.dh-repository-owner }}/lightningd:${{ inputs.version }}${{ matrix.tag_suffix }}") + TAG_ARGS=(-t "${DH_REPOSITORY_OWNER}/lightningd:${VERSION}${TAG_SUFFIX}") if [[ "$PUSHLATEST" == "true" ]]; then - TAG_ARGS+=(-t "${{ inputs.dh-repository-owner }}/lightningd:latest${{ matrix.tag_suffix }}") + TAG_ARGS+=(-t "${DH_REPOSITORY_OWNER}/lightningd:latest${TAG_SUFFIX}") fi docker buildx imagetools create "${TAG_ARGS[@]}" $DIGEST_REFS diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 6244891c74a0..03a106439168 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -30,9 +30,11 @@ jobs: - name: Determine PyPI distribution location id: set-values - run: | - if [[ "${{ inputs.dist-location }}" != "" ]]; then - DISTLOCATION="${{ inputs.dist-location }}" + env: + DIST_LOCATION: ${{ inputs.dist-location }} + run: | + if [[ -n "$DIST_LOCATION" ]]; then + DISTLOCATION="$DIST_LOCATION" elif [[ "${{ github.ref_type }}" == "tag" ]] && [[ ! "${{ inputs.version }}" =~ rc ]]; then DISTLOCATION="prod" else From 567cb8dd2579105d3aa1000622e013f20d361be2 Mon Sep 17 00:00:00 2001 From: SashaMIT Date: Wed, 5 Aug 2026 20:06:53 +0700 Subject: [PATCH 2/2] ci: fix pypi-publish env/run YAML after input binding Correct indentation and bind remaining version/ref inputs via env. Co-authored-by: Cursor --- .github/workflows/pypi-publish.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 03a106439168..e943c7ad12b6 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -31,17 +31,20 @@ jobs: - name: Determine PyPI distribution location id: set-values env: - DIST_LOCATION: ${{ inputs.dist-location }} - run: | + DIST_LOCATION: ${{ inputs.dist-location }} + REF_TYPE: ${{ github.ref_type }} + VERSION: ${{ inputs.version }} + EVENT_DIST_LOCATION: ${{ github.event.inputs.dist-location }} + run: | if [[ -n "$DIST_LOCATION" ]]; then DISTLOCATION="$DIST_LOCATION" - elif [[ "${{ github.ref_type }}" == "tag" ]] && [[ ! "${{ inputs.version }}" =~ rc ]]; then + elif [[ "$REF_TYPE" == "tag" ]] && [[ ! "$VERSION" =~ rc ]]; then DISTLOCATION="prod" else DISTLOCATION="test" fi echo "DISTLOCATION=$DISTLOCATION" >> "$GITHUB_OUTPUT" - echo "EVENT DISTLOCATION: ${{ github.event.inputs.dist-location }}" + echo "EVENT DISTLOCATION: $EVENT_DIST_LOCATION" echo "Resolved dist-location: $DISTLOCATION" - name: Install uv