Use environment variables in workflow (#1865)
* Use environment variables in workflow * Add newsfragment
This commit is contained in:
parent
7916032a78
commit
eb49b28ea9
2 changed files with 5 additions and 1 deletions
5
.github/workflows/netlify.yaml
vendored
5
.github/workflows/netlify.yaml
vendored
|
@ -25,8 +25,11 @@ jobs:
|
||||||
id: readctx
|
id: readctx
|
||||||
# we need to find the PR number that corresponds to the branch, which we do by
|
# we need to find the PR number that corresponds to the branch, which we do by
|
||||||
# searching the GH API
|
# searching the GH API
|
||||||
|
env:
|
||||||
|
OWNER_LOGIN: ${{ github.event.workflow_run.head_repository.owner.login }}
|
||||||
|
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||||
run: |
|
run: |
|
||||||
head_branch='${{github.event.workflow_run.head_repository.owner.login}}:${{github.event.workflow_run.head_branch}}'
|
head_branch="${OWNER_LOGIN}:${HEAD_BRANCH}"
|
||||||
echo "head branch: $head_branch"
|
echo "head branch: $head_branch"
|
||||||
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
|
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
|
||||||
pr_number=$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
|
pr_number=$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
|
||||||
|
|
1
changelogs/internal/newsfragments/1865.clarification
Normal file
1
changelogs/internal/newsfragments/1865.clarification
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Use environment variables for Netlify build job.
|
Loading…
Add table
Add a link
Reference in a new issue