diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e71e408..30fc396 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: - name: "Setup Node Environment" uses: braintree/web-sdk-github-actions/actions/setup-node@main with: + cache: npm node-version-file: ${{ inputs.node-version-file }} - name: "Lint" diff --git a/.github/workflows/pr-title-jira-validation.yml b/.github/workflows/pr-title-jira-validation.yml index 893dcd1..a4dae21 100644 --- a/.github/workflows/pr-title-jira-validation.yml +++ b/.github/workflows/pr-title-jira-validation.yml @@ -66,7 +66,12 @@ jobs: inputs.jira-url-pattern != ''" runs-on: gh-2-core-ubuntu-latest steps: - - run: node '${{ github.action_path }}/../../dist/check-jira-reference.js' + - uses: actions/checkout@v6 + with: + repository: braintree/web-sdk-github-actions + ref: main + path: .web-sdk-github-actions + - run: node '.web-sdk-github-actions/dist/check-jira-reference.js' shell: bash env: PR_BODY: ${{ github.event.pull_request.body }} diff --git a/.github/workflows/release-dry-run.yml b/.github/workflows/release-dry-run.yml index ba01f05..c5f9836 100644 --- a/.github/workflows/release-dry-run.yml +++ b/.github/workflows/release-dry-run.yml @@ -53,10 +53,10 @@ jobs: steps: - uses: actions/checkout@v6 - - name: "Setup Node.js" - uses: actions/setup-node@v6 + - name: "Setup Node Environment" + uses: braintree/web-sdk-github-actions/actions/setup-node@main with: - node-version-file: .nvmrc + cache: npm - name: "Simulate version bump (dry run — no commit, branch, or tag)" id: bump diff --git a/.github/workflows/release-pipeline.yml b/.github/workflows/release-pipeline.yml index 4a18a8c..948f1c4 100644 --- a/.github/workflows/release-pipeline.yml +++ b/.github/workflows/release-pipeline.yml @@ -29,6 +29,11 @@ on: required: false type: string default: "ubuntu-latest" + dry-run: + description: "Simulate the release without publishing to npm or creating a GitHub release" + required: false + type: boolean + default: false secrets: npm-token: description: "npm access token (e.g. BRAINTREE_NPM_ACCESS_TOKEN)" @@ -66,6 +71,7 @@ jobs: version-type: ${{ inputs.version-type }} base-branch: ${{ inputs.base-branch }} github-token: ${{ secrets.GITHUB_TOKEN }} + dry-run: ${{ inputs.dry-run }} publish-npm: needs: bump-version @@ -79,6 +85,7 @@ jobs: uses: braintree/web-sdk-github-actions/actions/npm-publish@main with: npm-token: ${{ secrets.npm-token }} + dry-run: ${{ inputs.dry-run }} publish-release: needs: publish-npm @@ -92,3 +99,4 @@ jobs: uses: braintree/web-sdk-github-actions/actions/release-notes@main with: github-token: ${{ secrets.GITHUB_TOKEN }} + dry-run: ${{ inputs.dry-run }} diff --git a/.github/workflows/stale-cleanup.yml b/.github/workflows/stale-cleanup.yml index c2e4ce7..8c5c501 100644 --- a/.github/workflows/stale-cleanup.yml +++ b/.github/workflows/stale-cleanup.yml @@ -87,7 +87,7 @@ jobs: contents: write steps: - name: "Remove stale branches" - uses: fpicalausa/remove-stale-branches@7c4f2afe88a36c0f9114cd958380979b9d7323fb + uses: fpicalausa/remove-stale-branches@9b829bc2975ade0c61e64e9613def53ec0732440 # 2.6.1 with: days-before-branch-stale: ${{ inputs.branch-days-stale }} days-before-branch-delete: ${{ inputs.branch-days-close }} diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index 7185715..3ae68c2 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -15,9 +15,9 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 + - name: "Setup Node Environment" + uses: braintree/web-sdk-github-actions/actions/setup-node@main with: - node-version-file: .nvmrc cache: npm - run: npm ci diff --git a/actions/npm-publish/action.yml b/actions/npm-publish/action.yml index d5090c7..f798d04 100644 --- a/actions/npm-publish/action.yml +++ b/actions/npm-publish/action.yml @@ -17,15 +17,12 @@ inputs: runs: using: "composite" steps: - - name: "Setup Node.js with registry" - uses: actions/setup-node@v6 + - name: "Setup Node Environment" + uses: braintree/web-sdk-github-actions/actions/setup-node@main with: - node-version-file: .nvmrc registry-url: ${{ inputs.registry-url }} - - - name: "Install dependencies" - run: npm ci - shell: bash + cache: npm + install-dependencies: true - name: "Publish to npm" run: npm publish --provenance ${{ inputs.dry-run == 'true' && '--dry-run' || '' }} diff --git a/actions/release-notes/action.yml b/actions/release-notes/action.yml index fae709e..0e114fb 100644 --- a/actions/release-notes/action.yml +++ b/actions/release-notes/action.yml @@ -18,6 +18,11 @@ outputs: runs: using: "composite" steps: + - name: "Setup Node Environment" + uses: braintree/web-sdk-github-actions/actions/setup-node@main + with: + cache: npm + - name: "Checkout latest main" run: | git checkout main @@ -33,12 +38,7 @@ runs: - name: "Extract release notes from CHANGELOG" id: notes - run: | - { - echo 'release_details<> "$GITHUB_OUTPUT" + run: node '${{ github.action_path }}/../../dist/extract-release-notes.js' shell: bash - name: "Create GitHub release" diff --git a/actions/version-bump/action.yml b/actions/version-bump/action.yml index 004e7c3..f66398f 100644 --- a/actions/version-bump/action.yml +++ b/actions/version-bump/action.yml @@ -31,9 +31,9 @@ runs: - uses: ${{ github.action_path }}/../setup-git - name: "Setup Node.js" - uses: actions/setup-node@v6 + uses: braintree/web-sdk-github-actions/actions/setup-node@main with: - node-version-file: .nvmrc + cache: npm - name: "Validate CHANGELOG" run: node '${{ github.action_path }}/../../dist/validate-changelog.js'