-
Notifications
You must be signed in to change notification settings - Fork 36
38 lines (33 loc) · 1.04 KB
/
pkg-pr.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
name: Publish Approved Pull Requests
on:
pull_request_review:
types: [submitted]
pull_request:
types: [opened, synchronize, reopened]
jobs:
check:
runs-on: ubuntu-latest
outputs:
has-permissions: ${{ steps.checkPermissions.outputs.require-result || github.event.pull_request.user.login == github.repository_owner }}
steps:
- name: Check permissions
id: checkPermissions
# Only run permissions check if this is triggered by a review
if: github.event_name == 'pull_request_review'
uses: actions-cool/check-user-permission@v2
with:
require: "write"
publish:
needs: check
if: needs.check.outputs.has-permissions == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: Build package
run: xargs deno task build:npm < version.txt
- run: npx pkg-pr-new publish --compact ./npm