Skip to content

Commit

Permalink
WIP 332 Show Netlify preview URL in Job summary
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Aug 14, 2024
1 parent 3eea4e6 commit d8d2c12
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
id-token: write # to verify the deployment, originates from an appropriate source

# Deploy to the github-pages environment
environment:
Expand Down Expand Up @@ -135,3 +135,18 @@ jobs:
echo ""
echo "the URL of the draft site that Netlify provides"
echo "${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }}"
- name: Set Job Summary
uses: actions/github-script@v6
with:
script: |
const deployUrl = JSON.parse(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url;
github.rest.checks.update({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: context.runId,
output: {
title: 'Netlify Deployment',
summary: `Netlify Preview URL: ${deployUrl}`
}
});

0 comments on commit d8d2c12

Please sign in to comment.