Skip to content

Commit

Permalink
tryng out pkg.pr.new
Browse files Browse the repository at this point in the history
  • Loading branch information
theoephraim committed Aug 2, 2024
1 parent 3483b9a commit 5052f33
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/external-pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# thanks to https://github.com/systeminit/si/blob/main/.github/workflows/community-check.yml

name: Label community PR

on:
pull_request_target:
types:
- opened
- synchronize
- reopened

jobs:
check-is-community:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
env:
DMNO_STAFF: "theoephraim philmillman"
steps:
- name: Check PR author
id: check_author
run: |
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
if ! [[ "${DMNO_STAFF}" =~ "$PR_AUTHOR" ]]; then
echo "Authored by DMNO community member!"
echo "requires-community-tag=true" >> $GITHUB_OUTPUT
else
echo "Authored by DMNO staff"
fi
- name: Label PR
uses: actions/github-script@v5
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }},
labels: [ steps.check_author.outputs.requires-community-tag && 'community' && 'staff' ]
});
23 changes: 23 additions & 0 deletions .github/workflows/release-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish Any Commit
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: 'pnpm'
- name: Install node deps
run: pnpm i

- name: Build
run: pnpm build

- run: pnpx pkg-pr-new publish
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"typescript": "^5.4.5"
},
"engines": {
"node": "^18.17.1 || ^20.3.0 || >=21.0.0",
"pnpm": ">=9.1.1"
"node": "^20.3.0 || >=21.0.0",
"pnpm": ">=9.6.0"
},
"packageManager": "pnpm@9.1.1"
"packageManager": "pnpm@9.6.0"
}

0 comments on commit 5052f33

Please sign in to comment.