Skip to content

payload

payload #21

Workflow file for this run

name: cibuild
on:
push
jobs:
myci:
runs-on: ubuntu-latest
steps:
- uses: quenktechnologies/.github/actions/node/build@master
- name: Create Pull Request
id: create_pr
run: |
TOKEN="${{ secrets.GITHUB_TOKEN }}"
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 $PAYLOAD \
https://api.github.com/repos/$GITHUB_REPOSITORY/pulls)
PR_URL=$(echo "$RESPONSE" | jq -r '.html_url')
echo "Pull request created: $PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}