Skip to content

Commit 3d5df00

Browse files
Daniel Parkwraithgar
Daniel Park
authored andcommitted
chore(ci): add input to cli deps pr workflow
Moves workflow to create NPM CLI dependency pull request from npm/node. Adds input to workflow dispatch trigger PR-URL: #3294 Credit: @gimli01 Close: #3294 Reviewed-by: @darcyclarke
1 parent 7b56bfd commit 3d5df00

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Create CLI Deps PR"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
npmVersion:
7+
description: "NPM Version"
8+
required: true
9+
default: '"6.x.x" or "latest"'
10+
11+
jobs:
12+
create-pull-request:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.NPM_ROBOT_USER_PAT }}
16+
NPM_VERSION: ${{ github.event.inputs.npmVersion }}
17+
steps:
18+
- name: Checkout npm/node
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
ref: master
23+
repository: "npm/node"
24+
token: ${{ secrets.NPM_ROBOT_USER_PAT }}
25+
- name: Run dependency updates and create PR
26+
run: |
27+
npm_tag=""
28+
if [ "$NPM_VERSION" == "latest" ]
29+
then
30+
npm_tag=`npm view npm@latest version`
31+
else
32+
npm_tag="$NPM_VERSION"
33+
fi
34+
35+
git config user.name "npm-robot"
36+
git config user.email "[email protected]"
37+
git checkout -b "npm-$npm_tag"
38+
./tools/update-npm.sh "$npm_tag"
39+
git push origin "npm-$npm_tag"
40+
gh_release_body=`gh release view v"$npm_tag" -R npm/cli`
41+
echo $gh_release_body
42+
gh pr create -R "npm/node" -B "$base_branch" -H "npm:$release_branch_name" --title "deps(cli): upgrade npm to $npm_version" --body "$gh_release_body"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ npm-debug.log
2727
/coverage
2828
/*.tgz
2929
/.editorconfig
30+
.vscode/

0 commit comments

Comments
 (0)