Skip to content

Commit 8730eed

Browse files
committed
Get root version for composer
1 parent a71606c commit 8730eed

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/php.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ jobs:
7979
- name: Get composer cache directory
8080
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
8181

82+
- name: Get COMPOSER_ROOT_VERSION from composer.json branch alias
83+
run: |
84+
ROOT_VERSION=$(composer config extra.branch-alias.dev-master)
85+
if [ -z "$ROOT_VERSION" ]; then
86+
echo "Could not read extra.branch-alias.dev-master from composer.json" >&2
87+
exit 1
88+
fi
89+
echo "COMPOSER_ROOT_VERSION=$ROOT_VERSION" >> "$GITHUB_ENV"
90+
8291
- name: Cache composer dependencies
8392
uses: actions/cache@v5
8493
with:
@@ -141,6 +150,15 @@ jobs:
141150
- name: Get composer cache directory
142151
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
143152

153+
- name: Get COMPOSER_ROOT_VERSION from composer.json branch alias
154+
run: |
155+
ROOT_VERSION=$(composer config extra.branch-alias.dev-master)
156+
if [ -z "$ROOT_VERSION" ]; then
157+
echo "Could not read extra.branch-alias.dev-master from composer.json" >&2
158+
exit 1
159+
fi
160+
echo "COMPOSER_ROOT_VERSION=$ROOT_VERSION" >> "$GITHUB_ENV"
161+
144162
- name: Cache composer dependencies
145163
uses: actions/cache@v5
146164
with:
@@ -184,6 +202,15 @@ jobs:
184202
- name: Get composer cache directory
185203
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
186204

205+
- name: Get COMPOSER_ROOT_VERSION from composer.json branch alias
206+
run: |
207+
ROOT_VERSION=$(composer config extra.branch-alias.dev-master)
208+
if [ -z "$ROOT_VERSION" ]; then
209+
echo "Could not read extra.branch-alias.dev-master from composer.json" >&2
210+
exit 1
211+
fi
212+
echo "COMPOSER_ROOT_VERSION=$ROOT_VERSION" >> "$GITHUB_ENV"
213+
187214
- name: Cache composer dependencies
188215
uses: actions/cache@v5
189216
with:
@@ -248,6 +275,15 @@ jobs:
248275
- name: Get composer cache directory
249276
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
250277

278+
- name: Get COMPOSER_ROOT_VERSION from composer.json branch alias
279+
run: |
280+
ROOT_VERSION=$(composer config extra.branch-alias.dev-master)
281+
if [ -z "$ROOT_VERSION" ]; then
282+
echo "Could not read extra.branch-alias.dev-master from composer.json" >&2
283+
exit 1
284+
fi
285+
echo "COMPOSER_ROOT_VERSION=$ROOT_VERSION" >> "$GITHUB_ENV"
286+
251287
- name: Cache composer dependencies
252288
uses: actions/cache@v5
253289
with:

0 commit comments

Comments
 (0)