-
Notifications
You must be signed in to change notification settings - Fork 3.2k
59 lines (56 loc) · 1.79 KB
/
create-node-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This file is automatically added by @npmcli/template-oss. Do not edit.
name: "Create Node PR"
on:
workflow_dispatch:
inputs:
spec:
description: "The npm spec to create the PR from"
required: true
default: 'latest'
branch:
description: "The major node version to serve as the base of the PR. Should be `main` or a number like `18`, `19`, etc."
required: true
default: 'main'
dryRun:
description: "Setting this to anything will run all the steps except opening the PR"
jobs:
create-pull-request:
name: Create Node PR
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
id: node
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
cache: npm
- name: Check Git Status
run: node scripts/git-dirty.js
- name: Reset Deps
run: node scripts/resetdeps.js
- name: Checkout Node
uses: actions/checkout@v3
with:
token: ${{ secrets.NODE_PULL_REQUEST_TOKEN }}
repository: nodejs/node
fetch-depth: 0
path: node
- name: Create Node Pull Request
env:
GITHUB_TOKEN: ${{ secrets.NODE_PULL_REQUEST_TOKEN }}
run: |
DRY_RUN=$([ -z "${{ inputs.dryRun }}" ] && echo "" || echo "--dry-run")
node scripts/create-node-pr.js ${{ inputs.spec }} ${{ inputs.branch }} "$DRY_RUN"