paygoc6 / action-pull-request-another-repo

Action for create pull request in another repository
Apache License 2.0
37 stars 83 forks source link

Allow force push #19

Open jacopocarlini opened 1 year ago

jacopocarlini commented 1 year ago

Added a variable to allow the force push on the other repo to update the PR.

allow_force_push: [optional] Allow force push. Push with --force flag.

Why: If you re-run this action but the PR is still open you get an error (branch already exists).

Example:

name: Push File

on: push

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Create pull request
      uses: paygoc6/action-pull-request-another-repo@main
      env:
        API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
      with:
        source_folder: 'source-folder'
        destination_repo: 'user-name/repository-name'
        destination_folder: 'folder-name'
        destination_base_branch: 'branch-name'
        destination_head_branch: 'branch-name'
        user_email: 'user-name@paygo.com.br'
        user_name: 'user-name'
        pull_request_reviewers: 'reviewers'
        allow_force_push: 'true'
zhongyuan-jin commented 1 year ago

had the similiar issue, can we merge this one? thanks