-
Notifications
You must be signed in to change notification settings - Fork 33
45 lines (38 loc) · 1.25 KB
/
labeled_pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Labeled Pull Requests
on:
pull_request:
types: [labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
publish-tagged-packages:
name: Publish Tagged Packages to NPM
if: github.ref != 'refs/heads/master' && contains(github.event.pull_request.labels.*.name, 'feature')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install
run: |
npm ci
npm install -D commander execa prettier
npx -y ultra-runner --raw --recursive prepublishOnly
- name: Get Files
id: files
uses: jitterbit/get-changed-files@v1
with:
format: 'json'
- name: Publish Packages
run: npm run publish-tagged-packages -- --tag '${{ github.event.pull_request.head.ref }}' --files '${{ steps.files.outputs.added_modified }}'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}