-
Notifications
You must be signed in to change notification settings - Fork 129
Repo to be archived, but README doesn't provide full replacement #143
Comments
It looks like the CLI doesn't have an upsert, but something along the lines of |
@heiskr Would something like this work the same?
|
I wonder if there's a nifty way in bash to share the arguments between the commands. It looks great to me though :) Pull request welcome |
This comes from @kov in cli/cli#5792 (reply in thread). I'm not actually sure it's a full replacement of the functionality. Would be nice to confirm; otherwise, only a fully fledged action can be a proper substitute. |
I'd think something like this could work, its two lines 🤷🏼 gh_pr_up() { gh pr create $* || gh pr edit $* }
gh_pr_up --title "A new pull request" --body "Something" |
Submitted a patch in #144 |
This is what I was trying in my action: gh pr edit -B main || gh pr create -l "sync" -B main --title "Pulling ${{ github.ref }} into main" -H ${{ secrets.INTERMEDIATE_BRANCH }} -b "This PR synchronizes the public and private docs repo." Could it work like that? |
Adding this here incase anyone wants to use it. I attempted to use However, I believe @heiskr answer would be the solution to edit the body of the pr when needed. pull-request:
name: Create Pull Request
needs: [check-commit]
if: ${{ needs.check-commit.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
outputs:
pr_number: ${{ steps.pr-number.outputs.pull_request_number }}
steps:
- uses: actions/checkout@v3
- name: Get Current Date
id: date
run: |
echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Get Git Short Commit
id: git-short
run: |
echo "short_sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
- name: Open Pull Request
id: open-pr
run: |
gh pr create --label "label" --title "title" --body "body" --base base --head head
- name: Get Pull Request Number
id: pr-number
run: echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" >> $GITHUB_OUTPUT
- name: Comment on Pull Request
id: pr-comment
run: |
gh pr comment ${{ steps.pr-number.outputs.pull_request_number }} --body "body." |
So, for my needs, turns out I don't need |
The README example using
gh pr create
is incomplete. Thepull-request
action allowed to update existing sync PRs; this is not the case withgh pr create
.If the repo is going to be archived, will we be able to still use it? If not, what's a full replacement?
The text was updated successfully, but these errors were encountered: