Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change title of generated PR to include Openapi PR name #193

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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