Support $tag substitution in asset names
This commit is contained in:
		
							parent
							
								
									14569a2d34
								
							
						
					
					
						commit
						2658ad41ec
					
				@ -9,8 +9,8 @@ You must provide:
 | 
			
		||||
 | 
			
		||||
- `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}`
 | 
			
		||||
- `file`: A local file to be uploaded as the asset.
 | 
			
		||||
- `asset_name`: The name the file gets as an asset on a release.
 | 
			
		||||
- `tag`: The tag to uploaded into. If you want the current event's tag, use `${{ github.ref }}`
 | 
			
		||||
- `asset_name`: The name the file gets as an asset on a release. Use `$tag` to include the tag name.
 | 
			
		||||
- `tag`: The tag to uploaded into. If you want the current event's tag, use `${{ github.ref }}` (the `refs/tags/` prefix will be automatically stripped).
 | 
			
		||||
- `overwrite`: If an asset with the same name already exists, overwrite it.
 | 
			
		||||
 | 
			
		||||
Optional Arguments
 | 
			
		||||
 | 
			
		||||
@ -99,7 +99,7 @@ function run() {
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                const asset_name = core.getInput('asset_name', { required: true });
 | 
			
		||||
                const asset_name = core.getInput('asset_name', { required: true }).replace(/\$tag/g, tag);
 | 
			
		||||
                yield upload_to_release(release, file, asset_name, tag, overwrite, octokit, context);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -93,7 +93,7 @@ async function run() {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            const asset_name = core.getInput('asset_name', { required: true });
 | 
			
		||||
            const asset_name = core.getInput('asset_name', { required: true }).replace(/\$tag/g, tag);
 | 
			
		||||
            await upload_to_release(release, file, asset_name, tag, overwrite, octokit, context);
 | 
			
		||||
        }
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user