diff --git a/$GITHUB_OUTPUT b/$GITHUB_OUTPUT new file mode 100644 index 0000000..b93e50a --- /dev/null +++ b/$GITHUB_OUTPUT @@ -0,0 +1,3 @@ +head_sha=${GITHUB_SHA} +base_hash=${BASE_HASH} +base_needed=true diff --git a/.gitea/workflows/cicd-start.yaml b/.gitea/workflows/cicd-start.yaml index 10a3e9a..2acc4a8 100644 --- a/.gitea/workflows/cicd-start.yaml +++ b/.gitea/workflows/cicd-start.yaml @@ -2,7 +2,7 @@ name: CICD Start on: push: - branches: [ main, develop, feature/* ] + branches: [ main, develop ] pull_request: branches: [ main, develop ] workflow_dispatch: @@ -30,11 +30,6 @@ jobs: base_hash: ${{ steps.base-decision.outputs.base_hash }} steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.sha }} - - name: Audit trigger context env: EVENT_NAME: ${{ github.event_name }} @@ -60,36 +55,19 @@ jobs: echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts fi - - name: Compute base hash and base-needed signal + - name: Compute routing signal id: base-decision run: | set -e - compute_hash() { - local file1="$1" - local file2="$2" - sha256sum "${file1}" "${file2}" | sha256sum | cut -c1-16 - } + # Keep this workflow container-agnostic: do not rely on checkout/actions/node. + # docker-build-base handles canonical base hash/existence checks. + echo "head_sha=${GITHUB_SHA}" >> "${GITHUB_OUTPUT}" + echo "base_hash=deferred" >> "${GITHUB_OUTPUT}" + echo "base_needed=true" >> "${GITHUB_OUTPUT}" - if [ ! -f "Dockerfile.cicd-base" ] || [ ! -f ".dockerignore" ]; then - echo "❌ Required hash inputs are missing in workspace" - ls -la - exit 1 - fi - - BASE_HASH=$(compute_hash "Dockerfile.cicd-base" ".dockerignore") - - BASE_REF_HASH="${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd-base:${BASE_HASH}" - - echo "Base hash: ${BASE_HASH}" - echo "Base ref: ${BASE_REF_HASH}" - - echo "head_sha=${GITHUB_SHA}" >> "$GITHUB_OUTPUT" - echo "base_hash=${BASE_HASH}" >> "$GITHUB_OUTPUT" - # Route through docker-build-base always; it already performs robust - # registry/base existence checks and can short-circuit heavy rebuilds. - echo "Base rebuild decision delegated to Docker Build Base workflow" - echo "base_needed=true" >> "$GITHUB_OUTPUT" + echo "Routing via docker-build-base.yaml" + echo "Base hash delegated to Docker Build Base workflow" - name: Dispatch downstream workflow if: steps.base-decision.outcome == 'success' && steps.base-decision.outputs.head_sha != '' && steps.base-decision.outputs.base_needed != ''