This action determines the Composer root version based on the specified branch and exports it as COMPOSER_ROOT_VERSION environment variable. It's designed to be flexible, allowing you to specify both the branch and the working directory for the Composer command to determine the root version.
Create a new workflow file, for example, .github/workflows/integrate.yml, and add the following code to it.
---
on:
push:
branches:
- master
pull_request:
name: 🔍 Continuous integration
jobs:
integrate:
runs-on: ubuntu-latest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v4
# ...
- name: 🎯 Get Composer Root Version
uses: wayofdev/gh-actions/actions/composer/get-root-version@master
with:
branch: master
working-directory: '.'
# ...
...For details, see actions/composer/get-root-version/action.yml.
Real-world examples can be found in the wayofdev/laravel-package-tpl repository.
branch, optional: The name of the branch, defaults to"master".working-directory, optional: The working directory to use, defaults to".".
none
-
The
COMPOSER_ROOT_VERSIONenvironment variable contains the root version if it has been defined asbranch-aliasincomposer.json.{ "extra": { "branch-alias": { "dev-master": "11.0-dev" } } }