-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Determine composer version once
Co-authored-by: Rob <rob.bast@gmail.com>
- Loading branch information
1 parent
8c3b7a3
commit 48fc074
Showing
5 changed files
with
121 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs | ||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions | ||
|
||
name: "Determine composer version from Dockerfile" | ||
|
||
description: "Determines the composer version from a Dockerfile and exports it as COMPOSER_VERSION_MAJOR, COMPOSER_VERSION_MAJOR_MINOR, and COMPOSER_VERSION_MAJOR_MINOR_PATCH environment variables." | ||
|
||
inputs: | ||
working-directory: | ||
default: "." | ||
description: "Which directory to use as working directory" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: "Determine composer version from Dockerfile" | ||
run: | | ||
echo "COMPOSER_VERSION_MAJOR=$(grep -oP 'COMPOSER_VERSION \K\d+\.\d+\.\d+' Dockerfile | cut -d '.' -f 1)" >> $GITHUB_ENV | ||
echo "COMPOSER_VERSION_MAJOR_MINOR=$(grep -oP 'COMPOSER_VERSION \K\d+\.\d+\.\d+' Dockerfile | cut -d '.' -f 1,2)" >> $GITHUB_ENV | ||
echo "COMPOSER_VERSION_MAJOR_MINOR_PATCH=$(grep -oP 'COMPOSER_VERSION \K\d+\.\d+\.\d+' Dockerfile)" >> $GITHUB_ENV | ||
shell: "bash" | ||
working-directory: "${{ inputs.working-directory }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.