Skip to content

Commit

Permalink
Merge branch 'master' into refactor/dedicated_static_content_to_check…
Browse files Browse the repository at this point in the history
…_surge
  • Loading branch information
tbouffard authored Apr 17, 2024
2 parents 249a2d9 + 979d540 commit fa1c4ee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/surge-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ jobs:
echo "workflow_run: ${{toJSON(github.event.workflow_run)}}"
echo "workflow_run.head_sha: ${{github.event.workflow_run.head_sha}}"
# https://github.com/orgs/community/discussions/25220#discussioncomment-8697399
- name: Find associated pull request
id: pr
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const response = await github.rest.search.issuesAndPullRequests({
q: 'repo:${{ github.repository }} is:pr sha:${{ github.event.workflow_run.head_sha }}',
per_page: 1,
})
const items = response.data.items
if (items.length < 1) {
console.error('No PRs found')
return
}
const pullRequestNumber = items[0].number
console.info("Pull request number is", pullRequestNumber)
return pullRequestNumber
- name: deploy to Surge
uses: afc163/surge-preview@v1
with:
Expand Down

0 comments on commit fa1c4ee

Please sign in to comment.