Skip to content

Commit

Permalink
Change title of generated PR to include Openapi PR name (#193)
Browse files Browse the repository at this point in the history
* Change title of generated PR to include Openapi PR name

Making the generated PR titles more descriptive will make the changes in release notes more clear.

* Update .github/workflows/python-client-gen.yml

Co-authored-by: Andrew Starr-Bochicchio <[email protected]>

---------

Co-authored-by: Andrew Starr-Bochicchio <[email protected]>
  • Loading branch information
danaelhe and andrewsomething authored Sep 21, 2023
1 parent ce976d5 commit c96e146
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/python-client-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,29 @@ jobs:
echo "Add and commit changes step failed. It's possible the branch ${{ env.NEW_BRANCH }} already existed. Please delete the branch and re-run the pipeline."
exit 1
- name: Set pr_title outputs
id: pr_title_var
run: echo "PR_TITLE=$(gh pr list --search "${{ github.event.inputs.openapi_short_sha }}" --json title --jq '.[0].title' --repo digitalocean/openapi --state merged)" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check pr_title outputs
run: echo ${{ steps.pr_title_var.outputs.PR_TITLE }}

- name: Create Pull Request
id: create-pr
if: steps.add-commit-changes.outcome == 'success'
run: |
export CURRENT=$(cat DO_OPENAPI_COMMIT_SHA.txt)
export TARGET=${{ github.event.inputs.openapi_short_sha }}
export TITLE="${{ steps.pr_title_var.outputs.PR_TITLE }}"
envsubst < scripts/pr_body.md_tmpl > pr_body.md
cat changelist.md >> pr_body.md
echo "PR BODY:"
cat pr_body.md
gh pr create \
--title "[bot] Re-Generate w/ digitalocean/openapi@$TARGET" \
--title "[bot] $TITLE: Re-Generated From digitalocean/openapi@$TARGET" \
--body-file pr_body.md \
--head "${{ env.NEW_BRANCH }}" \
-r digitalocean/api-cli
Expand Down

0 comments on commit c96e146

Please sign in to comment.