Skip to content

Commit

Permalink
fix: set outputs earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Feb 21, 2024
1 parent bd635af commit 3e64491
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ async function action(pr: PullRequest): Promise<void> {

const tfResponse = requestSchema.parse(tfResponseRaw);

// Set outputs
setOutput('request_id', tfResponse.id);
setOutput('request_url', `${tfInstance}/requests/${tfResponse.id}`);

// Create Pull Request status in state pending
const usePullRequestStatuses = getBooleanInput('update_pull_request_status');
if (usePullRequestStatuses) {
Expand Down Expand Up @@ -210,10 +214,6 @@ async function action(pr: PullRequest): Promise<void> {
notice(`Final state is: ${finalState}`);
notice(`Infra state is: ${infraError ? 'Failed' : 'OK'}`);

// Set outputs
setOutput('request_id', tfResponse.id);
setOutput('request_url', `${tfInstance}/requests/${tfResponse.id}`);

// Switch Pull Request Status to final state
if (usePullRequestStatuses) {
await pr.setStatus(
Expand Down

0 comments on commit 3e64491

Please sign in to comment.