Skip to content

Commit 61c9ced

Browse files
committed
Set GH_REPO for neater gh api calls
1 parent e0f4ef2 commit 61c9ced

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/deploy-preview.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- name: Create deployment
1616
id: deployment
1717
env:
18+
GH_REPO: ${{ github.repository }}
1819
GH_TOKEN: ${{ secrets.GH_TOKEN_MANAGE_ENVS }}
1920
run: |
2021
ref=$(gh pr view ${{ github.event.inputs.issue }} --json headRefOid -q .headRefOid)
@@ -23,12 +24,12 @@ jobs:
2324
echo "url=$url" >> $GITHUB_OUTPUT
2425
2526
# create environment, deployment and success status
26-
gh api -X PUT repos/${{ github.repository }}/environments/$env
27-
deployment=$(gh api repos/${{ github.repository }}/deployments \
27+
gh api -X PUT repos/{owner}/{repo}/environments/$env
28+
deployment=$(gh api repos/{owner}/{repo}/deployments \
2829
-f ref=$ref \
2930
-f environment=$env \
30-
-f required_contexts[]=netlify/${{ github.owner }}/deploy-preview -q .id)
31-
gh api -X POST repos/${{ github.repository }}/deployments/$deployment/statuses \
31+
-F required_contexts[]=netlify/{owner}/deploy-preview -q .id)
32+
gh api -X POST repos/{owner}/{repo}/deployments/$deployment/statuses \
3233
-f state=success \
3334
-f environment_url=$url
3435

0 commit comments

Comments
 (0)