Skip to content

Commit

Permalink
Update test-meticulous-create-deployment.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Que3216 authored Oct 22, 2024
1 parent 509dda7 commit 3300a1e
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/test-meticulous-create-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ on:
workflow_dispatch: {}

permissions:
actions: write
contents: read
statuses: write
pull-requests: write
packages: read
contents: write
deployments: write

jobs:
create-deployment:
Expand Down Expand Up @@ -62,22 +59,14 @@ jobs:
echo "Curling https://api.github.com/repos/$OWNER/$REPO/deployments"
# Create deployment
DEPLOYMENT_ID=$(curl -s -X POST \
RESPONSE=$(curl -X POST \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/$OWNER/$REPO/deployments \
-d @- <<EOF | jq -r '.id'
{
"ref": "$GITHUB_REF",
"description": "$DESCRIPTION",
"environment": "$ENVIRONMENT_NAME",
"payload": {
"web_url": "$PREVIEW_URL"
}
}
EOF
)
-d "{\"ref\":\"$GITHUB_REF\",\"environment\":\"$ENVIRONMENT_NAME\",\"payload\":{ \"web_url\": \"$PREVIEW_URL\" },\"description\":\"$DESCRIPTION\"}")
echo $RESPONSE
DEPLOYMENT_ID=$(echo $RESPONSE | jq -r '.id')
echo "Created deployment with ID: $DEPLOYMENT_ID"
Expand Down

0 comments on commit 3300a1e

Please sign in to comment.