Detects whether an extension's version strictly increased between two git references. Works for plugins (composer.json) and apps (manifest.xml).
- Reads the version at
old-refand atnew-ref— fromcomposer.json(.version) for plugins, or frommanifest.xml(/manifest/meta/version) for apps.composer.jsontakes precedence when both are present. - Reports
bumped: trueonly when the version strictly increased (version-aware compare, handles 3- and 4-segment versions and treats a pre-release like1.0.0-rc1as lower than the final1.0.0) - Ignores no-op edits, downgrades/reverts, and cases where the version cannot be read (e.g. a newly created branch)
| Input | Description | Required | Default |
|---|---|---|---|
old-ref |
The git ref/sha for the previous state (e.g. the PR base sha) | Yes | - |
new-ref |
The git ref/sha for the new state (e.g. the PR head sha) | Yes | - |
path |
Path to the extension root containing composer.json (plugin) or manifest.xml (app) |
No | . |
| Output | Description |
|---|---|
bumped |
'true' if the version strictly increased, otherwise 'false' |
previous-version |
The version at old-ref (empty if not found) |
current-version |
The version at new-ref (empty if not found) |
Note: the caller must check out the repository with
fetch-depth: 0so both refs are available togit show.Note: this action requires
jqand GNUsort(forsort -V) on the runner; apps additionally needpython3(preinstalled on GitHub-hosted runners) to readmanifest.xml.
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: shopware/github-actions/version-bump@main
id: detect
with:
old-ref: ${{ github.event.pull_request.base.sha }}
new-ref: ${{ github.event.pull_request.head.sha }}
- if: steps.detect.outputs.bumped == 'true'
run: echo "Version bumped ${{ steps.detect.outputs.previous-version }} -> ${{ steps.detect.outputs.current-version }}"For the ready-made Slack notification, use the version-bump-notify reusable workflow instead of wiring this action up yourself.