funding
Synchronizes funding metadata between composer.json
and
.github/FUNDING.yml
.
Description
The funding
command merges supported funding metadata declared in Composer
and GitHub formats so both files stay aligned:
- Composer
fundingentries withtype=githubare normalized to GitHub Sponsors handles in.github/FUNDING.yml. - Composer
fundingentries withtype=customare normalized tocustomURLs in.github/FUNDING.yml. - Existing
githubandcustomentries from.github/FUNDING.ymlare mirrored back intocomposer.json. - Unsupported providers are preserved in their original format.
Usage
composer funding
composer funding [options]
composer dev-tools funding -- [options]
vendor/bin/dev-tools funding [options]
Options
--composer-file(optional)- Path to the Composer manifest to synchronize. Default:
Factory::getComposerFile(). --funding-file(optional)- Path to the GitHub funding file to synchronize. Default:
.github/FUNDING.yml. --dry-run- Preview funding metadata drift without writing files.
--check- Exit with code
1when synchronized funding metadata would change either file. --interactive- Prompt before writing drifted funding metadata files.
--json- Emit a structured machine-readable payload instead of the normal terminal output.
--pretty-json- Emit the same structured payload with indentation for terminal inspection.
Examples
Synchronize the default files:
composer funding
Preview funding drift:
composer funding --dry-run
Validate funding metadata in CI:
composer funding --check
Use custom paths:
composer funding --composer-file=packages/example/composer.json --funding-file=packages/example/.github/FUNDING.yml
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success. Funding metadata was already aligned or was updated successfully. |
| 1 | Failure. --check
detected drift or a write failed. |
Behavior
- Supports GitHub Sponsors handles and
customURLs as synchronized managed entries. - Preserves unsupported Composer funding providers and unsupported GitHub funding YAML keys.
- Normalizes
composer.jsonwithcomposer normalizeafter applying funding metadata updates. - Creates
.github/FUNDING.ymlwhen Composer declares supported funding metadata and the file is missing. - Skips writing
.github/FUNDING.ymlwhen neither side declares supported funding metadata. - Renders a unified diff during
--dry-runand--checkso local runs and CI logs show the managed changes clearly.