Skip to content

Commit

Permalink
payload
Browse files Browse the repository at this point in the history
  • Loading branch information
metasansana committed Aug 14, 2023
1 parent c041c6e commit e2c50f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
id: create_pr
run: |
TOKEN="${{ secrets.GITHUB_TOKEN }}"
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH=$(git symbolic-ref --short HEAD)
TITLE=$(git log -1 --format=%s HEAD)
BODY=$(git log -1 --format=%B HEAD)
PAYLOAD="{\"title\": \"$TITLE\", \"head\": \"$BRANCH\", \"body\": \"$BODY\", \"base\": \"master\"}"
RESPONSE=$(curl -X POST \
-H "Authorization: token $TOKEN" \
-d "{\"title\": \"Auto Pull Request\", \"head\": \"$BRANCH_NAME\", \"base\": \"master\"}" \
-d $PAYLOAD \
https://api.github.com/repos/$GITHUB_REPOSITORY/pulls)
PR_URL=$(echo "$RESPONSE" | jq -r '.html_url')
Expand Down

0 comments on commit e2c50f9

Please sign in to comment.