[READ-ONLY] Mirror of https://github.com/danielroe/uppt. A composite GitHub Action that turns conventional commits into a draft release PR, tags the PR on merge, and stages publishing to npm via OIDC
github-action
npm
npmjs
oidc
staged-publish
trusted-publishing
1name: 'uppt/pr'
2description: 'Parse conventional commits since the last tag and open or update a draft release PR.'
3author: 'Daniel Roe'
4
5branding:
6 icon: 'git-pull-request'
7 color: 'black'
8
9inputs:
10 token:
11 description: 'GitHub token. Needs `contents: write` and `pull-requests: write`.'
12 required: false
13 default: ${{ github.token }}
14 base-branch:
15 description: 'Branch the release PR is opened against.'
16 required: false
17 default: ${{ github.event.repository.default_branch }}
18 node-version:
19 description: 'Node version for the scripts. Needs `--experimental-strip-types` support (22.6+, 24+ recommended).'
20 required: false
21 default: '24'
22 checkout:
23 description: 'Whether the action should run `actions/checkout` itself. Set to `false` if the caller has already checked out with `fetch-depth: 0`.'
24 required: false
25 default: 'true'
26 packages:
27 description: 'Newline-separated list of publishable workspace directories, relative to the repo root. Each line is a path or glob (e.g. `packages/*`); `!`-prefixed entries are excluded; workspaces with `"private": true` are skipped. Omit for single-package repos.'
28 required: false
29 default: ''
30
31runs:
32 using: composite
33 steps:
34 - name: Validate event
35 shell: bash
36 env:
37 EVENT_NAME: ${{ github.event_name }}
38 run: |
39 set -euo pipefail
40 if [ "$EVENT_NAME" != "push" ] && [ "$EVENT_NAME" != "workflow_dispatch" ]; then
41 echo "::error::danielroe/uppt/pr only supports 'push' and 'workflow_dispatch' events, got '$EVENT_NAME'."
42 exit 1
43 fi
44
45 - name: Checkout
46 if: inputs.checkout == 'true'
47 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
48 with:
49 fetch-depth: 0
50 token: ${{ inputs.token }}
51 persist-credentials: false
52
53 - name: Setup Node
54 uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
55 with:
56 node-version: ${{ inputs.node-version }}
57 package-manager-cache: false
58
59 - name: Update changelog and open/update release PR
60 shell: bash
61 env:
62 GITHUB_TOKEN: ${{ inputs.token }}
63 RELEASE_BASE: ${{ inputs.base-branch }}
64 PACKAGES: ${{ inputs.packages }}
65 run: node --experimental-strip-types ${{ github.action_path }}/../scripts/update-changelog.ts