Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/module-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ on:
description: 'Optional JSON object merged into extra.altis.modules in the test-root composer.json. Used to enable opt-in module features for the CI run, e.g. ''{"media":{"private-media":true}}''.'
default: ''
type: string
composer-config:
description: 'Optional JSON object shallow-merged into the test-root composer.json at the top level. Use to inject keys like `repositories` for sibling deps not yet on Packagist, e.g. ''{"repositories":{"wpackagist":{"type":"composer","url":"https://wpackagist.org"}}}''. Pass repositories in object form (named keys), not array form, to coexist with the per-package vcs entry the workflow adds automatically.'
default: ''
type: string
secrets:
DOCKER_USERNAME:
required: true
Expand Down Expand Up @@ -115,6 +119,7 @@ jobs:
env:
BASE_BRANCH: ${{ steps.base.outputs.base-branch }}
MODULE_CONFIG: ${{ inputs.module-config }}
COMPOSER_CONFIG: ${{ inputs.composer-config }}
shell: bash
run: |
set -euo pipefail
Expand All @@ -135,6 +140,16 @@ jobs:
mv composer.json.tmp composer.json
fi

# Shallow-merge any caller-provided composer config (top-level keys like `repositories`).
# Runs before the per-package vcs entry below so callers passing `repositories` in object
# form coexist with the auto-added `repositories.$ALTIS_PACKAGE` key.
if [[ -n "$COMPOSER_CONFIG" ]]; then
jq --argjson cfg "$COMPOSER_CONFIG" \
'. + $cfg' \
composer.json > composer.json.tmp
mv composer.json.tmp composer.json
fi

# Use GitHub as the source for test to avoid packagist lag causing a race condition
composer config "repositories.$ALTIS_PACKAGE" vcs "https://github.com/humanmade/altis-${ALTIS_PACKAGE#altis/}.git"

Expand Down
Loading