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

[Feature request] Detect if target repo already has an open PR and append change, instead of opening new PR. #13

Open
DCSBL opened this issue Jul 2, 2021 · 2 comments

Comments

@DCSBL
Copy link

DCSBL commented Jul 2, 2021

Is your feature request related to a problem? Please describe.
I use this action to sync files to a few repos by opening a PR, some of which are not maintained that often. For those repos every time a sync is started a new PR is opened while old ones are still open.

Describe the solution you'd like
Is it possible that this actions detects that there still is an open PR and just adds a new commit to that branch? (Maybe this needs to be configurable)

Describe alternatives you've considered
Just accept it and close 'old' PR's manually.

@varunsridharan
Copy link
Owner

@DCSBL as of now we dont store any kind of logs on the pull request opened by this action.

Any pull request for this is helpful

@ikstewa
Copy link

ikstewa commented Apr 6, 2024

I was able to achieve similar functionality by using another action to create the PR and using this action only for syncing the files to a consistent branch.

In the set of files being sync'd I also include a workflow to create the PR. This results in the target repo managing a single PR for the workflow changes.

name: Workflow Sync PR
on:
  push:
    branches:
      - workflow_sync
jobs:
  updatePR:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Extract changes
        run: |
          git reset origin/${{ github.event.repository.default_branch }}
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v6
        with:
          title: Workflow Sync
          commit-message: "Worklow: Sync workflow template"
          branch: workflow_sync
          base: ${{ github.event.repository.default_branch }}

From the source have the workflow sync to a consistent named branch:

      - uses: varunsridharan/action-github-workflow-sync@main
        with:
          AUTO_CREATE_NEW_BRANCH: true
          REPOSITORIES: |
            my-org/my-repo@workflow_sync
          WORKFLOW_FILES: |
            ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants