File tree Expand file tree Collapse file tree 2 files changed +28
-12
lines changed
Expand file tree Collapse file tree 2 files changed +28
-12
lines changed Original file line number Diff line number Diff line change @@ -6,17 +6,23 @@ Upload files to a GitHub release.
66
77``` yaml
88# …
9- steps :
10- # …
11- - name : Upload to release
12- uses :
cloudnode-pro/[email protected] 13- with :
14- # See the ‘Inputs’ section below for details.
15- gh-token : ${{ github.token }}
16- release-id : 123456 # Optional for `release` events.
17- files : |
18- path/to/file.txt; type=text/plain; name=File1.txt
19- path/to/foo/bar.baz; if=${{ github.event_name == 'release' }}
9+ jobs :
10+ publish :
11+ # …
12+ permissions :
13+ contents : write
14+ # …
15+ steps :
16+ # …
17+ - name : Upload to release
18+ uses :
cloudnode-pro/[email protected] 19+ with :
20+ # See the ‘Inputs’ section below for details.
21+ gh-token : ${{ github.token }}
22+ release-id : 123456 # Optional for `release` events.
23+ files : |
24+ path/to/file.txt; type=text/plain; name=File1.txt
25+ path/to/foo/bar.baz; if=${{ github.event_name == 'release' }}
2026` ` `
2127
2228## Inputs
@@ -65,5 +71,15 @@ files: |-
6571 /path/to/file3.txt; if=${{ 'foo' == 'bar' }}
6672` ` `
6773
74+ # ## Permissions
6875
76+ Uploading release assets requires the `contents : write`.
6977
78+ See : [Controlling permissions for GITHUB_TOKEN](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token)
79+
80+ Example :
81+
82+ ` ` ` yaml
83+ permissions:
84+ contents: write
85+ ` ` `
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ const responses = await Promise.all(
8686core . info ( "Done uploading files." ) ;
8787const failedUploads = responses . filter ( r => ! r . res . ok ) ;
8888if ( failedUploads . length > 0 ) {
89- core . error ( `Failed to upload ${ failedUploads } file${ failedUploads . length === 1 ? "" : "s" } :` ) ;
89+ core . error ( `Failed to upload ${ failedUploads . length } file${ failedUploads . length === 1 ? "" : "s" } :` ) ;
9090 for ( const failed of failedUploads ) {
9191 const body = await failed . res . text ( ) ;
9292 let parsed : string ;
You can’t perform that action at this time.
0 commit comments