From 855ee88f8f4463e6a7d1ed8d386a20fb8b2eb8f9 Mon Sep 17 00:00:00 2001 From: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Date: Mon, 25 Apr 2022 18:33:50 +0900 Subject: [PATCH] feat(get-modified-packages): make base-branch an input in order to be testable (#139) Signed-off-by: Kenji Miyake --- .github/workflows/test-composite-actions.yaml | 2 ++ get-modified-packages/README.md | 4 +++- get-modified-packages/action.yaml | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-composite-actions.yaml b/.github/workflows/test-composite-actions.yaml index 9e29c7b3..c1019a28 100644 --- a/.github/workflows/test-composite-actions.yaml +++ b/.github/workflows/test-composite-actions.yaml @@ -182,6 +182,8 @@ jobs: - name: Run get-modified-packages id: get-modified-packages uses: ./get-modified-packages + with: + base-branch: ${{ github.event.repository.default_branch }} - name: Check result of get-modified-packages run: | diff --git a/get-modified-packages/README.md b/get-modified-packages/README.md index 8a709549..ca350687 100644 --- a/get-modified-packages/README.md +++ b/get-modified-packages/README.md @@ -21,7 +21,9 @@ jobs: ## Inputs -None. +| Name | Required | Description | +| ----------- | -------- | ------------------------------------------------ | +| base-branch | false | The base branch to search for modified packages. | ## Outputs diff --git a/get-modified-packages/action.yaml b/get-modified-packages/action.yaml index 6160dfe9..c6ed4c6d 100644 --- a/get-modified-packages/action.yaml +++ b/get-modified-packages/action.yaml @@ -1,6 +1,12 @@ name: get-modified-packages description: "" +inputs: + base-branch: + description: "" + required: false + default: ${{ github.base_ref }} + outputs: modified-packages: description: "" @@ -17,7 +23,7 @@ runs: - name: Get modified packages id: get-modified-packages run: | - ${GITHUB_ACTION_PATH}/get-modified-packages.sh origin/${{ github.base_ref }} + ${GITHUB_ACTION_PATH}/get-modified-packages.sh origin/${{ inputs.base-branch }} shell: bash - name: Show result