Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix broken netlify ci (#8427)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Apr 27, 2022
1 parent 8f7e265 commit 6d22300
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/netlify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ jobs:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
steps:
- name: "🔍 Read PR details"
- name: "🔍 Read PR number"
id: readctx
# we need to find the PR number that corresponds to the branch, which we do by searching the GH API
# We need to find the PR number that corresponds to the branch, which we do by searching the GH API
# The workflow_run event includes a list of pull requests, but it doesn't get populated for
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
run: |
head_branch='${{github.event.workflow_run.head_repository.owner.login}}:${{github.event.workflow_run.head_branch}}'
echo "Head branch: $head_branch"
head_ref='${{github.event.workflow_run.head_sha}}'
echo "Head ref: $head_ref"
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
pr_number = $(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" | jq -r .[] | .number)
pr_number=$(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
jq -r '.[] | .number')
echo "PR number: $pr_number"
echo "::set-output name=prnumber::$pr_number"
echo "::set-output name=headref::$head_ref"
- name: Create Deployment ID
uses: altinukshini/deployment-action@v1.2.6
Expand All @@ -37,7 +35,7 @@ jobs:
transient_environment: true
environment: Netlify
initial_status: in_progress
ref: ${{ steps.readctx.outputs.headref }}
ref: ${{ github.event.workflow_run.head_sha }}

# There's a 'download artifact' action but it hasn't been updated for the
# workflow_run action (https://github.com/actions/download-artifact/issues/60)
Expand Down

0 comments on commit 6d22300

Please sign in to comment.