From ca75d2c45ebea6c6fca4bf96c36486b1dd298f9e Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 5 Sep 2023 10:54:51 -0400 Subject: [PATCH] allow configuring source of truth for versions --- .github/actions/auto-major-minor-release-v1/action.yml | 9 ++++++++- .github/actions/auto-patch-release-v1/action.yml | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/actions/auto-major-minor-release-v1/action.yml b/.github/actions/auto-major-minor-release-v1/action.yml index 12d22526..7b947dbc 100644 --- a/.github/actions/auto-major-minor-release-v1/action.yml +++ b/.github/actions/auto-major-minor-release-v1/action.yml @@ -7,6 +7,11 @@ inputs: release-command: required: true type: string + # A JSON file with a top-level key "version" + version-json: + required: "false" + type: string + default: "package.json" release-branch: required: true type: string @@ -53,7 +58,9 @@ runs: - name: Get version for later steps id: get-new-version shell: bash - run: echo version=$(node -pe 'require("./package.json").version') >> "$GITHUB_OUTPUT" + run: echo version=$(node -pe "require('./$JSON_FILE').version") >> "$GITHUB_OUTPUT" + env: + JSON_FILE: ${{ inputs.version-json }} - name: Generate commit list id: commit-list diff --git a/.github/actions/auto-patch-release-v1/action.yml b/.github/actions/auto-patch-release-v1/action.yml index 6a6d9e55..b62f2564 100644 --- a/.github/actions/auto-patch-release-v1/action.yml +++ b/.github/actions/auto-patch-release-v1/action.yml @@ -4,6 +4,11 @@ inputs: release-command: required: true type: string + # A JSON file with a top-level key "version" + version-json: + required: "false" + type: string + default: "package.json" release-branch: required: true type: string @@ -83,7 +88,9 @@ runs: - name: Get version for later steps id: get-new-version shell: bash - run: echo version=$(node -pe 'require("./package.json").version') >> "$GITHUB_OUTPUT" + run: echo version=$(node -pe "require('./$JSON_FILE').version") >> "$GITHUB_OUTPUT" + env: + JSON_FILE: ${{ inputs.version-json }} - name: Generate commit list id: commit-list