Skip to content

Commit

Permalink
Try creating a PR from workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
leehart committed Sep 29, 2023
1 parent 37881c9 commit eb06fa9
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/add_tagged_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,21 @@ jobs:
git commit -m "Add documentation for $VERSION_TAG"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge new branch into main branch, eyeball status
run: |
git pull origin main
git checkout main
git merge $BRANCH_NAME --no-commit
git status

- name: Add and commit all changes to the main branch and push
- name: Create pull request
run: |
git add .
git commit -m "Merge $BRANCH_NAME into main"
git push origin main
PR_TITLE="Merge $BRANCH_NAME into main"
PR_BODY="Automated pull request from GitHub Actions workflow"
RESPONSE=$(curl -X POST \
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/leehart/tmp_test_6/pulls \
-d '{
"title": "'"$PR_TITLE"'",
"body": "'"$PR_BODY"'",
"head": "'"$BRANCH_NAME"'",
"base": "main"
}')
echo "$RESPONSE"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit eb06fa9

Please sign in to comment.