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 }}`
 | 
					- `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}`
 | 
				
			||||||
- `file`: A local file to be uploaded as the asset.
 | 
					- `file`: A local file to be uploaded as the asset.
 | 
				
			||||||
- `asset_name`: The name the file gets as an asset on a release.
 | 
					- `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 }}`
 | 
					- `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.
 | 
					- `overwrite`: If an asset with the same name already exists, overwrite it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Optional Arguments
 | 
					Optional Arguments
 | 
				
			||||||
 | 
				
			|||||||
@ -99,7 +99,7 @@ function run() {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            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);
 | 
					                yield upload_to_release(release, file, asset_name, tag, overwrite, octokit, context);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -93,7 +93,7 @@ async function run() {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        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);
 | 
					            await upload_to_release(release, file, asset_name, tag, overwrite, octokit, context);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    } catch (error) {
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user