Skip to content

Commit

Permalink
add artifact paths to action output (#343)
Browse files Browse the repository at this point in the history
* artifactPath output

* return artifacts path

* doc

* Update action.yml

* stringify path

* add missing `)`

* add changefile

* rebuild dist

* update action.yml

Co-authored-by: FabianLars <fabianlars@fabianlars.de>
  • Loading branch information
Ludea and FabianLars committed Dec 15, 2022
1 parent 6a4e04e commit 40e660a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/artifacts-output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'action': patch
---

Add the paths of generated artifacts as an action output.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ jobs:
| `releaseId` | The ID of the created release |
| `releaseHtmlUrl` | The URL users can navigate to in order to view the created release |
| `releaseUploadUrl` | The URL for uploading assets to the created release |
| `artifactPaths` | The paths of the generated artifacts |

# Caveats

Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ outputs:
description: 'The URL users can navigate to in order to view the created release'
releaseUploadUrl:
description: 'The URL for uploading assets to the created release'
artifactPaths:
description: 'The paths of the generated artifacts'
runs:
using: 'node16'
main: 'packages/action/dist/index.js'
2 changes: 1 addition & 1 deletion packages/action/dist/index.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ async function run(): Promise<void> {
}

console.log(`Found artifacts:\n${artifacts.map((a) => a.path).join('\n')}`);
core.setOutput(
'artifactPaths',
JSON.stringify(artifacts.map((a) => a.path))
);

if (tagName && !releaseId) {
const packageJson = getPackageJson(projectPath);
Expand Down

0 comments on commit 40e660a

Please sign in to comment.