From 6b4faf07aa4ec75d39fb5612b8dfa5bf26776653 Mon Sep 17 00:00:00 2001 From: mattgrul <40339403+mattgrul@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:52:46 +0000 Subject: [PATCH 1/2] Allow partial updates via repository URL --- README.md | 9 ++++++++- action.yml | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0fbd82..cea5a08 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ jobs: cache-composer: false # Disable caching of the Composer cache directory artifact-name: my-composer-repo #Output the final build to an artifact named `my-composer-repo` retention-days: 30 # Keep the artifact for 30 days + repository-url: https://github.com/OWNER/REPO # Only scan and update packages in this repository env: SATIS_PATH: ${{ github.workspace }}/satis ``` @@ -65,10 +66,11 @@ There are 7 input values that can be configured for the action which are as foll | [composer-token](#composer-token) | No | `${{github.token}}` | The GitHub token to use | | [composer-version](#php--composer-versions) | No | 2.6 | The Composer version to use | | [satis-version](#satis-version) | No | main | The version of Satis to use | -| [satis-config](#satis-config) | No | `${{github.workspace}}` | The path to the Satis config file | +| [satis-config](#satis-config) | No | `null` | The path to the Satis config file | | [cache-composer](#cache-composer) | No | true | Whether or not to cache the composer files | | [artifact-name](#artifact-name) | No | modules-repository-build | The name of the final artifact | | [retention-days](#retention-days) | No | 90 | The duration to keep the final build artifact | +| [repository-url](#repository-url) | No | `null` | The duration to keep the final build artifact | ### PHP & Composer Versions @@ -146,6 +148,11 @@ with: satis-config: build ``` +### Repository URL + +If you only want to scan and update packages in a specific repository you can use the `repository-url` input value. This +should be the full URL of the repository to scan and update, for example, `https://github.com/OWNER/REPO` + ## Outputs There is 1 output for the action. diff --git a/action.yml b/action.yml index 857b7ca..3acde44 100644 --- a/action.yml +++ b/action.yml @@ -37,6 +37,9 @@ inputs: description: 'Duration to keep the build artifact, in days.' required: false default: '90' + repository-url: + description: 'Repository URL for partial updates.' + required: false outputs: satis-artifact: From f801c9c69972450ae4c8793253301cc02d98d8fb Mon Sep 17 00:00:00 2001 From: mattgrul <40339403+mattgrul@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:20:23 +0000 Subject: [PATCH 2/2] Allow repository URL to be passed --- README.md | 5 +++-- action.yml | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cea5a08..a972498 100644 --- a/README.md +++ b/README.md @@ -150,8 +150,9 @@ with: ### Repository URL -If you only want to scan and update packages in a specific repository you can use the `repository-url` input value. This -should be the full URL of the repository to scan and update, for example, `https://github.com/OWNER/REPO` +To speed up the build process you can use the `repository-url` input value to only scan and update the packages in a +specific repository. This should be the full URL of the repository to scan and update, for +example, `https://github.com/OWNER/REPO` and should be within the `satis.json` config file. ## Outputs diff --git a/action.yml b/action.yml index 3acde44..0b01bfb 100644 --- a/action.yml +++ b/action.yml @@ -107,7 +107,12 @@ runs: if [ -n "${{ inputs.satis-config }}" ]; then SATIS_CONFIG_PATH="${{ github.workspace }}/${{ inputs.satis-config }}/satis.json" fi - bin/satis build "$SATIS_CONFIG_PATH" ${{ env.SATIS_PATH }}/dist + SATIS_BUILD_COMMAND="bin/satis build \"$SATIS_CONFIG_PATH\" ${{ env.SATIS_PATH }}/dist" + if [ -n "${{ inputs.repository-url }}" ]; then + SATIS_BUILD_COMMAND="bin/satis build --repository-url ${{ inputs.repository-url }} \"$SATIS_CONFIG_PATH\" ${{ env.SATIS_PATH }}/dist" + fi + echo $SATIS_BUILD_COMMAND + eval $SATIS_BUILD_COMMAND shell: bash - id: create-tarball