Skip to content

Commit

Permalink
null maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Apr 11, 2024
1 parent 997b50e commit 9b0f309
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
id: get-info
uses: actions/github-script@v7
with:
result-encoding: string
script: |
let pr;
let workflowRun;
Expand Down Expand Up @@ -61,7 +60,7 @@ jobs:
if (!pr.labels.some((label) => label.name === "deploy-preview")) {
console.log(`PR ${pr.number} does not have the deploy-preview label`);
return "";
return null;
}
if (!workflowRun) {
Expand All @@ -79,15 +78,15 @@ jobs:
if (!workflowRun) {
console.log(`Could not find workflow run for PR ${pr.number}`);
return "";
return null;
}
const result = { pr: pr.number, runId: workflowRun.id };
console.log(result);
return JSON.stringify(result);
return result;
- name: Download site build from PR
if: ${{ steps.get-info.outputs.result }}
if: ${{ steps.get-info.outputs.result != 'null' }}
uses: actions/download-artifact@v4
with:
name: site
Expand All @@ -97,7 +96,7 @@ jobs:

- name: Deploy
id: deploy
if: ${{ steps.get-info.outputs.result }}
if: ${{ steps.get-info.outputs.result != 'null' }}
run: |
echo deploying site
ls -R site
Expand Down

0 comments on commit 9b0f309

Please sign in to comment.