From 04940620c1391d1553e834b74c9d3e3b50bbde5c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 26 Jan 2024 11:49:20 +0100 Subject: [PATCH 1/3] Add config entry to supported inputs --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index 076792c..da3d7e8 100644 --- a/action.yml +++ b/action.yml @@ -32,6 +32,11 @@ inputs: required: false default: "." + config: + description: 'List of lines to add to the `hyde.yml` config file' + required: false + default: "" + env-site-name: description: 'Set the `SITE_NAME` environment variable' required: false From 8fb3c56516c49c04f22f7706529288ac50297162 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 26 Jan 2024 11:55:07 +0100 Subject: [PATCH 2/3] Document the config input --- docs/index.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/index.md b/docs/index.md index 65e862f..651e16e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -189,6 +189,27 @@ Specifies the directory containing the source files to build. This is useful if * **Required**: `false` * **Default**: `"."` +### `config` + +You can also specify configuration options using the `config` input. The lines in this input will be appended to the `hyde.yml` file in the root directory, allowing you to configure many parts of the Hyde project before the build. + +* **Description**: List of lines to add to the `hyde.yml` config file +* **Required**: `false` +* **Default**: `""` + +Example: + +```yaml +- uses: hydephp/action@config-array + with: + config: | + # Enter key-value Yaml here: + name: Example + url: ${{ github.deployment.url }} +``` + +See the [HydePHP documentation](https://hydephp.com/docs/1.x/customization#yaml-configuration) for more information on the available configuration options and how to use the `hyde.yml` file. + ### Environment variables >warning If your inputs contain sensitive information, you should use [GitHub Secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) to store them. From e6c06b157dee17b55eb74f2fea20d4b61682142c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 26 Jan 2024 12:13:57 +0100 Subject: [PATCH 3/3] Set up configuration --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index da3d7e8..26fdd4f 100644 --- a/action.yml +++ b/action.yml @@ -122,6 +122,11 @@ runs: run: echo "TORCHLIGHT_TOKEN=${{ inputs.env-torchlight-token }}" >> .env shell: bash + - name: Set up configuration + if: inputs.config != '' + run: echo "${{ inputs.config }}" >> hyde.yml + shell: bash + - name: Build the site run: php hyde build --no-interaction --ansi shell: bash