Skip to content

Commit

Permalink
update configuration and create description file for action
Browse files Browse the repository at this point in the history
  • Loading branch information
rosven9856 committed May 30, 2024
1 parent 643a614 commit d6a74ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Composer package build"
description: "Composer package build from repository using GitHub Actions"
inputs:
BUILD_DIRECTORY_NAME:
description: "build directory name"
default: ".build"
BUILD_FILE_NAME:
description: "package file name"
default: "package.zip"
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.BUILD_DIRECTORY_NAME }}
- ${{ inputs.BUILD_FILE_NAME }}
8 changes: 4 additions & 4 deletions src/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ final class Configuration
*/
public function __construct ()
{
$directory = (string) getenv('BUILD_DIRECTORY');
$dirName = (string) getenv('BUILD_DIRECTORY_NAME');
$fileName = (string) getenv('BUILD_FILE_NAME');

$directory = !empty($directory) ? $directory : '.build';
$dirName = !empty($dirName) ? $dirName : '.build';
$fileName = !empty($fileName) ? $fileName : 'package.zip';

if (!defined('ROOT')) {
Expand All @@ -27,8 +27,8 @@ public function __construct ()

$this->options = [
'build' => [
'directory' => ROOT . '/' . $directory,
'file' => ROOT . '/' . $directory . '/' . $fileName,
'directory' => ROOT . '/' . $dirName,
'file' => ROOT . '/' . $dirName . '/' . $fileName,
]
];
}
Expand Down

0 comments on commit d6a74ca

Please sign in to comment.