diff --git a/.github/workflows/__greetings.yml b/.github/workflows/__greetings.yml index ef5d3ae..efe156f 100644 --- a/.github/workflows/__greetings.yml +++ b/.github/workflows/__greetings.yml @@ -10,7 +10,7 @@ permissions: {} jobs: greetings: - uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 permissions: contents: read issues: write diff --git a/.github/workflows/__need-fix-to-issue.yml b/.github/workflows/__need-fix-to-issue.yml index 32d73e8..f8768fe 100644 --- a/.github/workflows/__need-fix-to-issue.yml +++ b/.github/workflows/__need-fix-to-issue.yml @@ -18,7 +18,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 permissions: contents: read issues: write diff --git a/.github/workflows/__semantic-pull-request.yml b/.github/workflows/__semantic-pull-request.yml index 621adb3..0ccdfaf 100644 --- a/.github/workflows/__semantic-pull-request.yml +++ b/.github/workflows/__semantic-pull-request.yml @@ -12,7 +12,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 permissions: contents: write pull-requests: write diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 8f464ca..9a1b573 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -7,7 +7,7 @@ permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 permissions: contents: read statuses: write @@ -35,6 +35,13 @@ jobs: permissions: contents: read + test-action-package: + name: Test action "package" + needs: linter + uses: ./.github/workflows/__test-action-package.yml + permissions: + contents: read + test-action-setup-node: name: Test action "setup-node" needs: linter diff --git a/.github/workflows/__stale.yml b/.github/workflows/__stale.yml index ca61827..da13c33 100644 --- a/.github/workflows/__stale.yml +++ b/.github/workflows/__stale.yml @@ -8,7 +8,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 permissions: issues: write pull-requests: write diff --git a/.github/workflows/__test-action-package.yml b/.github/workflows/__test-action-package.yml new file mode 100644 index 0000000..89d7fc5 --- /dev/null +++ b/.github/workflows/__test-action-package.yml @@ -0,0 +1,49 @@ +name: Internal - Tests for "package" action + +on: + workflow_call: + +permissions: {} + +jobs: + test: + name: Test "package" (${{ matrix.working-directory }}) + runs-on: ubuntu-latest + permissions: + contents: read + strategy: + matrix: + include: + - working-directory: tests/npm + artifact-suffix: npm + - working-directory: tests/pnpm + artifact-suffix: pnpm + - working-directory: tests/pnpm-package-manager + artifact-suffix: pnpm-package-manager + - working-directory: tests/yarn + artifact-suffix: yarn + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - id: package + uses: ./actions/package + with: + working-directory: ${{ matrix.working-directory }} + artifact-name: package-tarball-${{ matrix.artifact-suffix }} + + - name: Check "package" outputs + run: | + if [ -z "${{ steps.package.outputs.package-tarball-path }}" ]; then + echo "package-tarball-path output is empty" + exit 1 + fi + + if [ ! -f "${{ steps.package.outputs.package-tarball-path }}" ]; then + echo "Generated package tarball does not exist" + exit 1 + fi + + if [ -z "${{ steps.package.outputs.package-tarball-artifact-id }}" ]; then + echo "package-tarball-artifact-id output is empty" + exit 1 + fi diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 28c6804..37b7603 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -293,7 +293,7 @@ jobs: security-events: write runs-on: *ci-runner steps: - - uses: hoverkraft-tech/ci-github-common/actions/checkout@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/checkout@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 - uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 with: languages: ${{ inputs.code-ql }} @@ -306,7 +306,7 @@ jobs: contents: read runs-on: *ci-runner steps: - - uses: hoverkraft-tech/ci-github-common/actions/checkout@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/checkout@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 - uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2 setup: @@ -327,42 +327,26 @@ jobs: volumes: ${{ fromJSON(needs.prepare.outputs.container-volumes || '[]') }} credentials: ${{ fromJSON(needs.prepare.outputs.container-username && format('{{"username":{0},"password":{1}}}',toJSON(needs.prepare.outputs.container-username),toJSON(secrets.container-password)) || '{}') }} outputs: - working-directory: ${{ steps.working-directory.outputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} build-env: ${{ steps.build-variables.outputs.env }} build-commands: ${{ steps.build-variables.outputs.commands }} build-artifact: ${{ steps.build-variables.outputs.artifact }} steps: - name: Checkout repository if: inputs.container == '' - uses: hoverkraft-tech/ci-github-common/actions/checkout@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/actions/checkout@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 - id: working-directory - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - WORKING_DIRECTORY_INPUT: ${{ inputs.working-directory }} + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 with: - script: | - const fs = require('node:fs'); - const path = require('node:path'); - - let workingDirectory = process.env.WORKING_DIRECTORY_INPUT || '.'; - if (!path.isAbsolute(workingDirectory)) { - workingDirectory = path.join(process.env.GITHUB_WORKSPACE, workingDirectory); - } - - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } - workingDirectory = path.resolve(workingDirectory); - core.debug(`Running in working directory: ${workingDirectory}`); - core.setOutput('working-directory', workingDirectory); + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: ${{ inputs.container && 'false' || 'true' }} - id: build-variables if: inputs.build != '' uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: - WORKING_DIRECTORY: ${{ steps.working-directory.outputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} BUILD_INPUT: ${{ inputs.build }} with: script: | @@ -460,11 +444,11 @@ jobs: packages: read id-token: write # Needed for getting local workflow actions steps: - - uses: hoverkraft-tech/ci-github-common/actions/checkout@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/checkout@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 if: inputs.container == '' - id: local-workflow-actions - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 with: actions-path: actions @@ -500,7 +484,7 @@ jobs: path-mapping: ${{ needs.prepare.outputs.path-mapping || '' }} # jscpd:ignore-start - - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 if: always() && steps.local-workflow-actions.outputs.repository with: actions-path: actions @@ -523,11 +507,11 @@ jobs: outputs: artifact-id: ${{ steps.build.outputs.artifact-id }} steps: - - uses: hoverkraft-tech/ci-github-common/actions/checkout@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/checkout@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 if: needs.setup.outputs.build-commands && inputs.container == '' - id: local-workflow-actions - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 with: actions-path: actions @@ -543,7 +527,7 @@ jobs: build-artifact: ${{ needs.setup.outputs.build-artifact }} # jscpd:ignore-start - - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 if: always() && steps.local-workflow-actions.outputs.repository with: actions-path: actions @@ -566,7 +550,7 @@ jobs: packages: read id-token: write # Needed for getting local workflow actions steps: - - uses: hoverkraft-tech/ci-github-common/actions/checkout@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/checkout@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 if: inputs.container == '' - if: needs.build.outputs.artifact-id && inputs.container == '' @@ -576,7 +560,7 @@ jobs: path: "/" - id: local-workflow-actions - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 with: actions-path: actions @@ -618,7 +602,7 @@ jobs: github-token: ${{ secrets.github-token || github.token }} # jscpd:ignore-start - - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + - uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 if: always() && steps.local-workflow-actions.outputs.repository with: actions-path: actions diff --git a/README.md b/README.md index 6b773f8..765143c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ _Actions for continuous integration steps: build, lint, and test._ #### - [Codecov](actions/codecov/README.md) +#### - [Package](actions/package/README.md) + #### - [Lint](actions/lint/README.md) #### - [Test](actions/test/README.md) diff --git a/actions/build/action.yml b/actions/build/action.yml index 3bb9a4c..fe85bb5 100644 --- a/actions/build/action.yml +++ b/actions/build/action.yml @@ -70,11 +70,17 @@ runs: # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 run: mkdir -p ./self-build-action/ && cp -r $GITHUB_ACTION_PATH/../* ./self-build-action/ + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: ${{ inputs.container && 'false' || 'true' }} + - id: setup-node if: inputs.container != 'true' uses: ./self-build-action/setup-node with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} dependencies-cache: | nx gatsby @@ -86,7 +92,7 @@ runs: if: inputs.container == 'true' uses: ./self-build-action/get-package-manager with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: @@ -122,15 +128,10 @@ runs: env: BUILD_COMMANDS: ${{ inputs.build-commands }} RUN_SCRIPT_COMMAND: ${{ inputs.container == 'true' && steps.get-package-manager.outputs.run-script-command || steps.setup-node.outputs.run-script-command }} - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} with: script: | - const fs = require('node:fs'); const workingDirectory = process.env.WORKING_DIRECTORY; - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); diff --git a/actions/codecov/action.yml b/actions/codecov/action.yml index 5d9c2ef..5109386 100644 --- a/actions/codecov/action.yml +++ b/actions/codecov/action.yml @@ -23,6 +23,12 @@ inputs: runs: using: "composite" steps: + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: "false" + # Check and install dependencies for codecov - name: Check Codecov dependencies id: check-codecov-deps @@ -153,9 +159,9 @@ runs: - name: ๐Ÿ“Š Upload coverage to Codecov uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: - directory: ${{ inputs.working-directory }} - root_dir: ${{ inputs.working-directory }} - working-directory: ${{ inputs.working-directory }} + directory: ${{ steps.working-directory.outputs.workspace-relative-path }} + root_dir: ${{ steps.working-directory.outputs.workspace-relative-path }} + working-directory: ${{ steps.working-directory.outputs.workspace-relative-path }} use_oidc: true disable_telem: true fail_ci_if_error: false diff --git a/actions/dependencies-cache/action.yml b/actions/dependencies-cache/action.yml index b5ab32e..770a45d 100644 --- a/actions/dependencies-cache/action.yml +++ b/actions/dependencies-cache/action.yml @@ -36,24 +36,30 @@ runs: # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 run: mkdir -p ./self-dependencies-cache-action/ && cp -r $GITHUB_ACTION_PATH/../* ./self-dependencies-cache-action/ + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: "false" + - id: has-installed-dependencies if: inputs.dependencies != '' uses: ./self-dependencies-cache-action/has-installed-dependencies with: dependencies: ${{ inputs.dependencies }} - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} - id: get-package-manager if: inputs.package-manager == '' uses: ./self-dependencies-cache-action/get-package-manager with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} - name: โ™ป๏ธ NX cache if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).nx == true uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: - path: ${{ inputs.working-directory }}/node_modules/.cache/nx + path: ${{ steps.working-directory.outputs.workspace-relative-path }}/node_modules/.cache/nx key: ${{ runner.os }}-cache-nx-${{ github.sha }} restore-keys: | ${{ runner.os }}-cache-nx- @@ -62,7 +68,7 @@ runs: if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).prettier == true uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: - path: ${{ inputs.working-directory }}/node_modules/.cache/prettier + path: ${{ steps.working-directory.outputs.workspace-relative-path }}/node_modules/.cache/prettier key: ${{ runner.os }}-cache-prettier-${{ github.sha }} restore-keys: | ${{ runner.os }}-cache-prettier- @@ -72,8 +78,8 @@ runs: uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: | - ${{ inputs.working-directory }}/.docusaurus - ${{ inputs.working-directory }}/node_modules/.cache/webpack + ${{ steps.working-directory.outputs.workspace-relative-path }}/.docusaurus + ${{ steps.working-directory.outputs.workspace-relative-path }}/node_modules/.cache/webpack key: ${{ runner.os }}-cache-docusaurus-${{ github.sha }} restore-keys: | ${{ runner.os }}-cache-docusaurus- @@ -82,7 +88,7 @@ runs: if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).vitest == true uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: - path: ${{ inputs.working-directory }}/node_modules/.vite/vitest + path: ${{ steps.working-directory.outputs.workspace-relative-path }}/node_modules/.vite/vitest key: ${{ runner.os }}-cache-vitest-${{ github.sha }} restore-keys: | ${{ runner.os }}-cache-vitest- @@ -91,7 +97,7 @@ runs: if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).astro == true uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: - path: ${{ inputs.working-directory }}/node_modules/.astro + path: ${{ steps.working-directory.outputs.workspace-relative-path }}/node_modules/.astro key: ${{ runner.os }}-cache-astro-${{ github.sha }} restore-keys: | ${{ runner.os }}-cache-astro- @@ -101,8 +107,8 @@ runs: uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: | - ${{ inputs.working-directory }}/.cache - ${{ inputs.working-directory }}/public + ${{ steps.working-directory.outputs.workspace-relative-path }}/.cache + ${{ steps.working-directory.outputs.workspace-relative-path }}/public key: ${{ runner.os }}-cache-gatsby-${{ github.sha }} restore-keys: | ${{ runner.os }}-cache-gatsby- @@ -111,7 +117,7 @@ runs: if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).storybook == true uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: - path: ${{ inputs.working-directory }}/node_modules/.cache/storybook + path: ${{ steps.working-directory.outputs.workspace-relative-path }}/node_modules/.cache/storybook key: ${{ runner.os }}-cache-storybook-${{ github.sha }} restore-keys: | ${{ runner.os }}-cache-storybook- @@ -121,25 +127,14 @@ runs: if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).jest == true uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} PACKAGE_MANAGER: ${{ steps.get-package-manager.outputs.package-manager }} with: # jscpd:ignore-start script: | - const fs = require('node:fs'); const path = require('node:path'); - let workingDirectory = process.env.WORKING_DIRECTORY || '.'; - if (!path.isAbsolute(workingDirectory)) { - workingDirectory = path.join(process.env.GITHUB_WORKSPACE, workingDirectory); - } - - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } - - workingDirectory = path.resolve(workingDirectory); + const workingDirectory = process.env.WORKING_DIRECTORY; core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); diff --git a/actions/get-package-manager/action.yml b/actions/get-package-manager/action.yml index 974e0e4..ebb7a42 100644 --- a/actions/get-package-manager/action.yml +++ b/actions/get-package-manager/action.yml @@ -30,28 +30,24 @@ outputs: runs: using: "composite" steps: + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: "false" + - id: get-package-manager uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} with: # jscpd:ignore-start script: | const fs = require('node:fs'); const path = require('node:path'); - let workingDirectory = process.env.WORKING_DIRECTORY || '.'; - if (!path.isAbsolute(workingDirectory)) { - workingDirectory = path.join(process.env.GITHUB_WORKSPACE, workingDirectory); - } + const workingDirectory = process.env.WORKING_DIRECTORY; core.debug(`Resolved working directory: ${workingDirectory}`); - - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } - - workingDirectory = path.resolve(workingDirectory); core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); diff --git a/actions/has-installed-dependencies/action.yml b/actions/has-installed-dependencies/action.yml index 94eba48..d6f1dcf 100644 --- a/actions/has-installed-dependencies/action.yml +++ b/actions/has-installed-dependencies/action.yml @@ -28,38 +28,30 @@ runs: # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 run: mkdir -p ./self-actions/ && cp -r $GITHUB_ACTION_PATH/../* ./self-actions/ + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: "false" + - id: get-package-manager if: inputs.package-manager == '' uses: ./self-actions/get-package-manager with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} - shell: bash # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 run: | rm -fr ./self-actions - - id: has-dependencies uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} with: # jscpd:ignore-start script: | - const fs = require('node:fs'); - const path = require('node:path'); - - let workingDirectory = process.env.WORKING_DIRECTORY || '.'; - if (!path.isAbsolute(workingDirectory)) { - workingDirectory = path.join(process.env.GITHUB_WORKSPACE, workingDirectory); - } - - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } - - workingDirectory = path.resolve(workingDirectory); + const workingDirectory = process.env.WORKING_DIRECTORY; core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); diff --git a/actions/lint/action.yml b/actions/lint/action.yml index a1168bf..f4d6366 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -48,11 +48,17 @@ runs: # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 run: mkdir -p ./self-lint-action/ && cp -r $GITHUB_ACTION_PATH/../* ./self-lint-action/ + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: ${{ inputs.container && 'false' || 'true' }} + - id: setup-node if: inputs.container != 'true' uses: ./self-lint-action/setup-node with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} dependencies-cache: | nx prettier @@ -61,22 +67,17 @@ runs: if: inputs.container == 'true' uses: ./self-lint-action/get-package-manager with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} - id: run-lint uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: RUN_LINT_COMMAND: ${{ inputs.container == 'true' && steps.get-package-manager.outputs.run-script-command || steps.setup-node.outputs.run-script-command }} - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} LINT_COMMAND: ${{ inputs.command }} with: script: | - const fs = require('node:fs'); const workingDirectory = process.env.WORKING_DIRECTORY; - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); @@ -103,9 +104,9 @@ runs: - name: ๐Ÿ“Š Parse lint reports if: always() - uses: hoverkraft-tech/ci-github-common/actions/parse-ci-reports@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/actions/parse-ci-reports@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} report-paths: ${{ inputs.report-file || 'auto:lint' }} path-mapping: ${{ inputs.path-mapping }} report-name: "Lint Results" diff --git a/actions/package/README.md b/actions/package/README.md new file mode 100644 index 0000000..5b897db --- /dev/null +++ b/actions/package/README.md @@ -0,0 +1,57 @@ + + +# GitHub Action: Package + +--- + + + +## Overview + +Action to create and upload an npm package tarball from a Node.js project. + +## Usage + +```yaml +- uses: hoverkraft-tech/ci-github-nodejs/actions/package@c9d9d041ba4ef35695ee469c4782fa6a8bbebbcc # 0.21.2 + with: + # Working directory where the package is packed. + # Can be absolute or relative to the repository root. + # + # Default: `.` + working-directory: . + + # Optional build artifact ID to download before packaging. + build-artifact-id: "" + + # Optional version to apply with `npm version` before packaging. + # The version is applied without creating a git tag. + version: "" + + # Name of the uploaded package tarball artifact + # Default: `package-tarball` + artifact-name: package-tarball +``` + +## Inputs + +| **Input** | **Description** | **Required** | **Default** | +| ----------------------- | ---------------------------------------------------------------- | ------------ | ----------------- | +| **`working-directory`** | Working directory where the package is packed. | **false** | `.` | +| | Can be absolute or relative to the repository root. | | | +| **`build-artifact-id`** | Optional build artifact ID to download before packaging. | **false** | - | +| | When provided, the artifact will be downloaded to the workspace. | | | +| **`version`** | Optional version to apply with `npm version` before packaging. | **false** | - | +| | The version is applied without creating a Git tag. | | | +| **`artifact-name`** | Name of the uploaded package tarball artifact | **false** | `package-tarball` | + +## Outputs + +| **Output** | **Description** | +| --------------------------------- | ---------------------------------------------- | +| **`package-tarball-path`** | Absolute path to the generated package tarball | +| **`package-tarball-artifact-id`** | Artifact ID of the uploaded package tarball | + +## Contributing + +Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-nodejs/blob/main/CONTRIBUTING.md) for more details. diff --git a/actions/package/action.yml b/actions/package/action.yml new file mode 100644 index 0000000..57ce8aa --- /dev/null +++ b/actions/package/action.yml @@ -0,0 +1,160 @@ +name: "Package" +description: "Action to create and upload an npm package tarball from a Node.js project" +author: hoverkraft +branding: + icon: package + color: blue + +inputs: + working-directory: + description: | + Working directory where the package is packed. + Can be absolute or relative to the repository root. + required: false + default: "." + build-artifact-id: + description: | + Optional build artifact ID to download before packaging. + When provided, the artifact will be downloaded to the workspace. + required: false + default: "" + build-artifact-path: + description: | + Optional path to the build artifact contents relative to the workspace root. + Used to locate the files to be included in the package when a build artifact is downloaded. + required: false + default: "${{ github.workspace }}" + version: + description: | + Optional version to apply with `npm version` before packaging. + The version is applied without creating a Git tag. + required: false + default: "" + artifact-name: + description: "Name of the uploaded package tarball artifact" + required: false + default: "package-tarball" + +outputs: + package-tarball-path: + description: "Absolute path to the generated package tarball" + value: ${{ steps.package.outputs.package-tarball-path }} + package-tarball-artifact-id: + description: "Artifact ID of the uploaded package tarball" + value: ${{ steps.upload-package-tarball.outputs.artifact-id }} + +runs: + using: "composite" + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - shell: bash + # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 + run: mkdir -p ./self-package-action/ && cp -r $GITHUB_ACTION_PATH/../* ./self-package-action/ + + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: "false" + + - id: setup-node + uses: ./self-package-action/setup-node + with: + working-directory: ${{ steps.working-directory.outputs.absolute-path }} + + - name: Download build artifacts + if: inputs.build-artifact-id != '' + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + with: + artifact-ids: ${{ inputs.build-artifact-id }} + path: ${{ inputs.build-artifact-path }} + + - id: package + name: Create package tarball for verification + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + env: + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} + RELEASE_VERSION: ${{ inputs.version }} + RUNNER_TEMP: ${{ runner.temp }} + with: + script: | + const fs = require('node:fs'); + const path = require('node:path'); + + const workingDirectory = process.env.WORKING_DIRECTORY; + core.debug(`Running in working directory: ${workingDirectory}`); + process.chdir(workingDirectory); + + const releaseVersion = (process.env.RELEASE_VERSION || '').trim(); + const runnerTemp = process.env.RUNNER_TEMP; + + if (releaseVersion) { + core.info(`Updating package version to provided release version: ${releaseVersion}`); + const npmVersionResult = await exec.getExecOutput( + 'npm', + ['version', releaseVersion, '--no-git-tag-version', '--no-workspaces-update'], + { + cwd: workingDirectory, + ignoreReturnCode: true, + }, + ); + + if (npmVersionResult.exitCode !== 0) { + core.setFailed(`npm version failed with exit code ${npmVersionResult.exitCode}`); + return; + } + } + + const npmPackResult = await exec.getExecOutput('npm', ['pack', '--json', '--pack-destination', runnerTemp], { + cwd: workingDirectory, + ignoreReturnCode: true, + }); + + core.debug(`npm pack stdout: ${npmPackResult.stdout}`); + core.debug(`npm pack stderr: ${npmPackResult.stderr}`); + + if (npmPackResult.exitCode !== 0) { + core.setFailed(`npm pack failed with exit code ${npmPackResult.exitCode}: ${npmPackResult.stderr}`); + return; + } + + let packageInfo; + try { + packageInfo = JSON.parse(npmPackResult.stdout); + } catch (error) { + core.setFailed(`Failed to parse npm pack output: ${error.message}`); + return; + } + + core.debug(`packageInfo: ${JSON.stringify(packageInfo)}`); + + const tarballName = packageInfo?.[0]?.filename; + if (!tarballName) { + core.setFailed('No tarball filename returned by npm pack'); + return; + } + + const tarballPath = path.join(runnerTemp, tarballName); + if (!fs.existsSync(tarballPath)) { + core.setFailed(`Tarball was not created at expected path: ${tarballPath}`); + return; + } + + core.info(`Generated package tarball: ${tarballPath}`); + core.setOutput('package-tarball-path', tarballPath); + + - name: Upload package tarball + id: upload-package-tarball + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: ${{ inputs.artifact-name }} + path: ${{ steps.package.outputs.package-tarball-path }} + if-no-files-found: error + + # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 + - shell: bash + if: always() + run: rm -fr ./self-package-action diff --git a/actions/setup-node/action.yml b/actions/setup-node/action.yml index 2bde2f7..6d22fd2 100644 --- a/actions/setup-node/action.yml +++ b/actions/setup-node/action.yml @@ -34,33 +34,29 @@ runs: # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 run: mkdir -p ./self-setup-node-action/ && cp -r $GITHUB_ACTION_PATH/../* ./self-setup-node-action/ + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: "false" + - id: get-package-manager if: inputs.package-manager == '' uses: ./self-setup-node-action/get-package-manager with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} - id: get-node-version-file uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} with: # jscpd:ignore-start script: | const path = require('node:path'); const fs = require('node:fs'); - let workingDirectory = process.env.WORKING_DIRECTORY || '.'; - if (!path.isAbsolute(workingDirectory)) { - workingDirectory = path.join(process.env.GITHUB_WORKSPACE, workingDirectory); - } - - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } - - workingDirectory = path.resolve(workingDirectory); + const workingDirectory = process.env.WORKING_DIRECTORY; core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); @@ -87,23 +83,13 @@ runs: if: steps.get-package-manager.outputs.package-manager == 'pnpm' uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} with: script: | const path = require('node:path'); const fs = require('node:fs'); - let workingDirectory = process.env.WORKING_DIRECTORY || '.'; - if (!path.isAbsolute(workingDirectory)) { - workingDirectory = path.join(process.env.GITHUB_WORKSPACE, workingDirectory); - } - - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } - - workingDirectory = path.resolve(workingDirectory); + const workingDirectory = process.env.WORKING_DIRECTORY; core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); @@ -138,7 +124,7 @@ runs: if: steps.get-package-manager.outputs.package-manager == 'pnpm' with: version: ${{ steps.get-pnpm-version.outputs.pnpm-version }} - package_json_file: ${{ inputs.working-directory }}/package.json + package_json_file: ${{ steps.working-directory.outputs.workspace-relative-path }}/package.json run_install: false - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 @@ -149,14 +135,14 @@ runs: registry-url: ${{ inputs.registry-url }} - shell: bash - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} run: ${{ steps.get-package-manager.outputs.install-command }} - if: inputs.dependencies-cache != '' uses: ./self-setup-node-action/dependencies-cache with: dependencies: ${{ inputs.dependencies-cache }} - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 - shell: bash diff --git a/actions/test/action.yml b/actions/test/action.yml index 2d38cc1..98692f6 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,11 +67,17 @@ runs: # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 run: mkdir -p ./self-test-action/ && cp -r $GITHUB_ACTION_PATH/../* ./self-test-action/ + - id: working-directory + uses: hoverkraft-tech/ci-github-common/actions/working-directory@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 + with: + working-directory: ${{ inputs.working-directory }} + enforce-path-in-workspace: ${{ inputs.container && 'false' || 'true' }} + - id: setup-node if: inputs.container != 'true' uses: ./self-test-action/setup-node with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} dependencies-cache: | nx jest @@ -81,23 +87,18 @@ runs: if: inputs.container == 'true' uses: ./self-test-action/get-package-manager with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} - id: run-test name: ๐Ÿงช Run tests uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: RUN_TEST_COMMAND: ${{ inputs.container == 'true' && steps.get-package-manager.outputs.run-script-command || steps.setup-node.outputs.run-script-command }} - WORKING_DIRECTORY: ${{ inputs.working-directory }} + WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }} TEST_COMMAND: ${{ inputs.command }} with: script: | - const fs = require('node:fs'); const workingDirectory = process.env.WORKING_DIRECTORY; - if (!fs.existsSync(workingDirectory)) { - core.setFailed(`The specified working directory does not exist: ${workingDirectory}`); - return; - } core.debug(`Running in working directory: ${workingDirectory}`); process.chdir(workingDirectory); @@ -126,9 +127,9 @@ runs: - name: ๐Ÿ“Š Parse coverage reports if: always() && inputs.coverage == 'github' id: parse-coverage-reports - uses: hoverkraft-tech/ci-github-common/actions/parse-ci-reports@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/actions/parse-ci-reports@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} report-name: "Coverage Results" report-paths: ${{ inputs.report-file || 'auto:test,auto:coverage' }} path-mapping: ${{ inputs.path-mapping }} @@ -136,7 +137,7 @@ runs: - name: ๐Ÿ“Š Add coverage PR comment if: always() && inputs.coverage == 'github' && github.event_name == 'pull_request' && steps.parse-coverage-reports.outputs.markdown - uses: hoverkraft-tech/ci-github-common/actions/create-or-update-comment@4bfbc05c189f1177cf7d47d3060cd1cbddf04ce2 # 0.32.0 + uses: hoverkraft-tech/ci-github-common/actions/create-or-update-comment@f5847cb398fe65d53794e6aba98ebdfa0801f691 # 0.32.0 with: title: "Code Coverage Report" body: ${{ steps.parse-coverage-reports.outputs.markdown }} @@ -145,7 +146,7 @@ runs: if: always() && inputs.coverage == 'codecov' uses: ./self-test-action/codecov with: - working-directory: ${{ inputs.working-directory }} + working-directory: ${{ steps.working-directory.outputs.absolute-path }} # FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684 - shell: bash diff --git a/tests/npm/package-lock.json b/tests/npm/package-lock.json index 89f4969..3f82df5 100644 --- a/tests/npm/package-lock.json +++ b/tests/npm/package-lock.json @@ -1,10 +1,12 @@ { "name": "test-for-ci-with-npm", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "test-for-ci-with-npm", + "version": "0.1.0", "dependencies": { "gatsby": "^5.16.1", "jest": "^30.2.0", @@ -91,6 +93,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz", "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -2722,6 +2725,7 @@ "resolved": "https://registry.npmjs.org/@gatsbyjs/reach-router/-/reach-router-2.0.1.tgz", "integrity": "sha512-gmSZniS9/phwgEgpFARMpNg21PkYDZEpfgEzvkgpE/iku4uvXqCrxr86fXbTpI9mkrhKS1SCTYmLGe60VdHcdQ==", "license": "MIT", + "peer": true, "dependencies": { "invariant": "^2.2.4", "prop-types": "^15.8.1" @@ -4519,6 +4523,7 @@ "resolved": "https://registry.npmjs.org/@parcel/core/-/core-2.8.3.tgz", "integrity": "sha512-Euf/un4ZAiClnlUXqPB9phQlKbveU+2CotZv7m7i+qkgvFn5nAGnrV4h1OzQU42j9dpgOxWi7AttUDMrvkbhCQ==", "license": "MIT", + "peer": true, "dependencies": { "@mischnic/json-sourcemap": "^0.1.0", "@parcel/cache": "2.8.3", @@ -5659,7 +5664,6 @@ "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -5679,7 +5683,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -5692,7 +5695,6 @@ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "license": "Apache-2.0", - "peer": true, "dependencies": { "dequal": "^2.0.3" } @@ -5702,7 +5704,6 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -5716,8 +5717,7 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@testing-library/jest-dom": { "version": "6.6.3", @@ -5799,8 +5799,7 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -6082,7 +6081,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", "license": "MIT", - "peer": true, "dependencies": { "@types/json-schema": "^7.0.7", "@typescript-eslint/scope-manager": "4.33.0", @@ -6107,7 +6105,6 @@ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "license": "MIT", - "peer": true, "dependencies": { "eslint-visitor-keys": "^2.0.0" }, @@ -6154,7 +6151,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/types": "4.33.0", "@typescript-eslint/visitor-keys": "4.33.0" @@ -6172,7 +6168,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", "license": "MIT", - "peer": true, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, @@ -6186,7 +6181,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@typescript-eslint/types": "4.33.0", "@typescript-eslint/visitor-keys": "4.33.0", @@ -6214,7 +6208,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/types": "4.33.0", "eslint-visitor-keys": "^2.0.0" @@ -6804,6 +6797,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -6870,6 +6864,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -7409,7 +7404,6 @@ "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.7.0", @@ -7430,7 +7424,6 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=4" } @@ -8050,6 +8043,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -9000,6 +8994,7 @@ "integrity": "sha512-zpEHTy1fjTMZCKLHUZoVeylt9XrzaIN2rbPXEt0k+q7JE5CkCZdo6bNq55bn24a69CH7ErAVLKijxJja4fw+UQ==", "hasInstallScript": true, "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -9709,7 +9704,6 @@ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -9822,8 +9816,7 @@ "version": "0.5.16", "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/dom-converter": { "version": "0.2.0", @@ -10477,6 +10470,7 @@ "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.3", @@ -10613,6 +10607,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.10.0.tgz", "integrity": "sha512-vcz32f+7TP+kvTUyMXZmCnNujBQZDNmcqPImw8b9PZ+16w1Qdm6ryRuYZYVaG9xRqqmAPr2Cs9FAX5gN+x/bjw==", "license": "BSD-3-Clause", + "peer": true, "dependencies": { "lodash": "^4.17.15", "string-natural-compare": "^3.0.1" @@ -10629,6 +10624,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -10692,6 +10688,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==", "license": "MIT", + "peer": true, "dependencies": { "aria-query": "^5.3.2", "array-includes": "^3.1.8", @@ -10721,6 +10718,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", "license": "MIT", + "peer": true, "dependencies": { "array-includes": "^3.1.8", "array.prototype.findlast": "^1.2.5", @@ -10753,6 +10751,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -12559,6 +12558,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/types": "5.62.0", @@ -13086,6 +13086,7 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.11.0.tgz", "integrity": "sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==", "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -15675,7 +15676,6 @@ "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "license": "MIT", - "peer": true, "bin": { "lz-string": "bin/bin.js" } @@ -17409,6 +17409,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", @@ -18019,6 +18020,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -18510,6 +18512,7 @@ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -18693,6 +18696,7 @@ "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.9.2" } @@ -19200,7 +19204,6 @@ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" } @@ -19229,6 +19232,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -20979,6 +20983,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "license": "(MIT OR CC0-1.0)", + "peer": true, "engines": { "node": ">=10" }, @@ -21531,6 +21536,7 @@ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.98.0.tgz", "integrity": "sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA==", "license": "MIT", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", diff --git a/tests/npm/package.json b/tests/npm/package.json index 75110a1..020afbe 100644 --- a/tests/npm/package.json +++ b/tests/npm/package.json @@ -1,5 +1,6 @@ { "name": "test-for-ci-with-npm", + "version": "0.1.0", "main": "src/index.js", "scripts": { "lint": "echo \"lint test\"", diff --git a/tests/pnpm-package-manager/package.json b/tests/pnpm-package-manager/package.json index 53282b5..632e735 100644 --- a/tests/pnpm-package-manager/package.json +++ b/tests/pnpm-package-manager/package.json @@ -1,5 +1,6 @@ { "name": "test-for-ci-with-pnpm-in-package-json", + "version": "0.1.0", "scripts": { "lint": "echo \"lint test\"", "build": "mkdir -p dist && echo \"build test\" > dist/test.txt", diff --git a/tests/pnpm/package.json b/tests/pnpm/package.json index 2a4b433..5f14d19 100644 --- a/tests/pnpm/package.json +++ b/tests/pnpm/package.json @@ -1,5 +1,6 @@ { "name": "test-for-ci-with-pnpm", + "version": "0.1.0", "scripts": { "lint": "echo \"lint test\"", "build": "mkdir -p dist && echo \"build test\" > dist/test.txt", diff --git a/tests/yarn/package.json b/tests/yarn/package.json index fd9d707..aa6c2bf 100644 --- a/tests/yarn/package.json +++ b/tests/yarn/package.json @@ -1,5 +1,6 @@ { "name": "test-for-ci-with-yarn", + "version": "0.1.0", "scripts": { "lint": "echo \"lint test\"", "build": "mkdir -p dist && echo \"build test\" > dist/test.txt",