From c30bcbd5baa8c0e8d384c7c85058df41cd9d6377 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Thu, 3 Oct 2024 21:59:23 +0200 Subject: [PATCH] Introduce checkout_directory --- .github/workflows/publish_node_package.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish_node_package.yml b/.github/workflows/publish_node_package.yml index f2f623d..521ef3c 100644 --- a/.github/workflows/publish_node_package.yml +++ b/.github/workflows/publish_node_package.yml @@ -13,6 +13,11 @@ on: required: false type: boolean default: false + checkout_directory: + description: 'Directory to checkout the repository to' + required: false + type: string + default: '.' disable_ignore_scripts_on_publish: description: 'If false, add --ignore-scripts flag to npm publish command' required: false @@ -52,7 +57,7 @@ on: required: false default: ${{ github.repository }} working_directory: - description: 'Working directory' + description: 'Working directory within $checkout_directory to run commands' required: false type: string default: '.' @@ -89,7 +94,7 @@ jobs: with: repository: ${{ inputs.repository_name }} ref: ${{ inputs.branch_name }} - path: ${{ inputs.working_directory}} + path: ${{ inputs.checkout_directory}} - name: Set release name id: set_release_name @@ -101,13 +106,13 @@ jobs: fi - name: "Set package version" - working-directory: ${{ inputs.working_directory }} + working-directory: ${{ inputs.checkout_directory }}/${{ inputs.working_directory }} run: | npm version prerelease --preid `git rev-parse --short HEAD`-`date +%Y%m%d%H%M` --no-git-tag-version - name: Set dependecies versions if: ${{ inputs.package_dependencies != '' }} - working-directory: ${{ inputs.working_directory }} + working-directory: ${{ inputs.checkout_directory }}/${{ inputs.working_directory }} run: | echo "## Dependencies used to build package" >> $GITHUB_STEP_SUMMARY for dependency in $(echo "${{ inputs.package_dependencies }}" | tr '\n' ' ') @@ -137,7 +142,7 @@ jobs: - name: Build package if: ${{ inputs.build_package }} - working-directory: ${{ inputs.working_directory }} + working-directory: ${{ inputs.checkout_directory }}/${{ inputs.working_directory }} run: | npm install --@flowforge:registry=${{ inputs.npm_registry_url }} npm run build @@ -156,7 +161,7 @@ jobs: - name: Publish package if: ${{ inputs.publish_package }} - working-directory: ${{ inputs.working_directory }} + working-directory: ${{ inputs.checkout_directory }}/${{ inputs.working_directory }} run: | npm publish ${{ env.NPM_PUBLISH_PARAMETERS }} --tag ${{ env.release_name }} env: