File tree Expand file tree Collapse file tree 3 files changed +54
-6
lines changed
Expand file tree Collapse file tree 3 files changed +54
-6
lines changed Original file line number Diff line number Diff line change 3737 persist-credentials : false
3838 ref : ${{ github.head_ref || github.ref }}
3939 - id : test1
40- name : Test defaults
40+ name : Test 1
4141 uses : ./
42+ - id : test2
43+ name : Test 2
44+ uses : ./
45+ with :
46+ pkg : vfile
47+ - id : test3
48+ name : Test 3
49+ uses : ./
50+ with :
51+ pkg : devlop
52+ version : 1.1.0
53+ - id : test4
54+ name : Test 4
55+ uses : ./
56+ with :
57+ pkg : colors
58+ scope : ${{ github.repository_owner }}
59+ - id : test5
60+ name : Test 5
61+ uses : ./
62+ with :
63+ pkg : grease
64+ scope : ${{ github.repository_owner }}
65+ version : 3.0.0-alpha.9
4266 - id : outputs
4367 name : Outputs
4468 run : |
69+ outputs
4570 echo steps.test1.outputs.url: ${{ steps.test1.outputs.url }}
71+ echo steps.test2.outputs.url: ${{ steps.test2.outputs.url }}
72+ echo steps.test3.outputs.url: ${{ steps.test3.outputs.url }}
73+ echo steps.test4.outputs.url: ${{ steps.test4.outputs.url }}
74+ echo steps.test5.outputs.url: ${{ steps.test5.outputs.url }}
Original file line number Diff line number Diff line change @@ -93,15 +93,15 @@ jobs:
9393
9494> **default**: `${{ github.event.repository.name }}`
9595
96- The name of the package.
96+ The name of the package (optional) .
9797
9898# ## `scope`
9999
100- The scope of the [package](#pkg).
100+ The scope of the [package](#pkg) (optional) .
101101
102102# ## `version`
103103
104- The version of the [package](#pkg) to include in the URL.
104+ The version of the [package](#pkg) to include in the URL (optional) .
105105
106106# # Outputs
107107
Original file line number Diff line number Diff line change @@ -6,6 +6,16 @@ name: npm-url
66author : ' @flex-development'
77description : Create a URL for the NPM registry
88inputs :
9+ pkg :
10+ default : ${{ github.event.repository.name }}
11+ description : package name
12+ required : false
13+ scope :
14+ description : package scope
15+ required : false
16+ version :
17+ description : package version
18+ required : false
919outputs :
1020 url :
1121 description : the public registry url
1828 run : |
1929 set -e
2030
21- # create registry url.
22- URL=
31+ # init registry url.
32+ URL=https://npmjs.com/package
33+
34+ # add package name to scope.
35+ [[ -n '${{ inputs.scope }}' ]] && URL=$URL/@${{ inputs.scope }}
36+
37+ # add package name to url.
38+ URL=$URL/${{ inputs.pkg }}
39+
40+ # add package version to url.
41+ [[ -n '${{ inputs.version }}' ]] && URL=$URL/v/${{ inputs.version }}
2342
2443 # set action output.
2544 echo "result=$(echo "$URL" | xargs)" >>$GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments