Skip to content

Commit 93b0c52

Browse files
NickDubCodex-
authored andcommitted
feat: add run URL output
1 parent e6ffc07 commit 93b0c52

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Ensure you have configured your remote action correctly, see below for an exampl
1414

1515
```yaml
1616
steps:
17-
- name: Dispatch an action and get the run ID
17+
- name: Dispatch an action and get the run ID and URL
1818
uses: codex-/return-dispatch@v1
1919
id: return_dispatch
2020
with:
@@ -26,8 +26,10 @@ steps:
2626
workflow_inputs: '{ "some_input": "value" }' # Optional
2727
workflow_timeout_seconds: 120 # Default: 300
2828

29-
- name: Use the output run ID
30-
run: echo ${{steps.return_dispatch.outputs.run_id}}
29+
- name: Use the output run ID and URL
30+
run: |
31+
echo ${{steps.return_dispatch.outputs.run_id}}
32+
echo ${{steps.return_dispatch.outputs.run_url}}
3133
```
3234
3335
### Receiving Repository Action

‎action.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ branding:
77
outputs:
88
run_id:
99
description: The identified Run ID.
10+
run_url:
11+
description: The URL of the Run.
1012
inputs:
1113
token:
1214
description: GitHub Personal Access Token for making API requests.

‎src/action.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ interface ActionWorkflowInputs {
4848

4949
export enum ActionOutputs {
5050
runId = "run_id",
51+
runUrl = "run_url",
5152
}
5253

5354
export function getConfig(): ActionConfig {

‎src/main.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ async function run(): Promise<void> {
6767
` URL: ${url}`,
6868
);
6969
core.setOutput(ActionOutputs.runId, id);
70+
core.setOutput(ActionOutputs.runUrl, url);
7071
return;
7172
}
7273
}

0 commit comments

Comments
 (0)