Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 2, 2023. It is now read-only.

Conversation

@m4heshd
Copy link
Contributor

@m4heshd m4heshd commented Aug 24, 2021

This PR adds following features:

Sample usage:

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        repository: "octocat/hello-world"
    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        destination_branch: "main"
        github_token: ${{ secrets.GITHUB_TOKEN }}

In this example, the PR will be created in octocat/hello-world.

Notes:

🔵 Manual input has the highest priority. Final fallback is GITHUB_REPOSITORY env var
🔵 Supports both bare and non-bare repositories
🔵 Does not depend on actions/checkout

🟢 Minimal amount of modifications to the original source
🟢 Changes are fully backwards compatible
🟢 Functionality has been tested in numerous possible scenarios

Related issues: #18, #55

@mansona
Copy link

mansona commented Feb 16, 2022

Hey I've just come across this today, it seems to be exactly what I need 🎉 is there any chance of getting it merged?

@m4heshd
Copy link
Contributor Author

m4heshd commented Feb 16, 2022

@mansona You can use my PR branch for the moment. I use this on pretty much all of my projects.

    - name: pull-request
      uses: m4heshd/pull-request@third-party-repos
      with:
        destination_branch: "main"
        github_token: ${{ secrets.GITHUB_TOKEN }}

Or you can simply fork it and use.

@wei
Copy link
Member

wei commented Feb 16, 2022

Thanks for the bump. Will review and try to merge it soon.

@mansona
Copy link

mansona commented Feb 17, 2022

@m4heshd yes I have been doing that to test this out 👍

one thing I will say as possible feedback, I had accidentally put the wrong name for the token for this action and it failed to create the PR, but it still showed as succeeding 🤔

https://github.com/mansona/test-copy-file-source/runs/5235589544?check_suite_focus=true#step:6:25

I don't know exactly how to do this but you might want to make sure that the exit code is correct in this scenario since I suspect that will be the most common error people will have (i.e. not having the right credentials set up)

@m4heshd
Copy link
Contributor Author

m4heshd commented Feb 21, 2022

@mansona Hmm.. 🤔. Gonna have to take a look at that. I already see what the issue is but need some free time on my hands to do some tests.

@mansona
Copy link

mansona commented Mar 10, 2022

@m4heshd do you want to share the issue and maybe I can take a look? i.e. if you know what the problem is then maybe write a brief description here and if i have time I can take a look 👍

@heiskr heiskr requested a review from a team November 28, 2022 16:15
@steven-pribilinskiy
Copy link

I'm trying to use the action in a private repo to no avail:

Given the following config:

name: Make PRs

on:
  workflow_dispatch:

jobs:
  createPullRequest:
    runs-on: ubuntu-latest
    steps:
      # https://github.com/actions/checkout v3.1.0
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
        with:
          repository: some/repo
          token: ${{ secrets.TOKEN }}

      - name: Mark github workspace as safe
        run: git config --global --add safe.directory /github/workspace

      - name: Create Pull Request
        uses: m4heshd/pull-request@third-party-repos
        with:
          source_branch: main
          destination_branch: dev
          pr_title: 'Merge released code into dev branch'
          pr_body: *An automated PR*
          github_token: ${{ secrets.TOKEN }}

we're getting an error:

fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace

@m4heshd
Copy link
Contributor Author

m4heshd commented Dec 21, 2022

@mansona Sorry I missed your last response. I'm gonna take a look at it again.

@steven-prybylynskyi It's because of #84. Not related to this PR. But it should be fixed now since the changes are merged.

Meanwhile, can y'all try my fork (m4heshd/pull-request@third-party-repos) again and give me an update?

@m4heshd
Copy link
Contributor Author

m4heshd commented Dec 22, 2022

@ReenigneArcher I saw your issue in my mail and now you've deleted it. Can you confirm if everything's working correctly?

@ReenigneArcher
Copy link

@ReenigneArcher I saw your issue in my mail and now you've deleted it. Can you confirm if everything's working correctly?

Sorry, my original issue was a dumb mistake on my part. I was accidentally using pr_template instead of pr_body, due to a copy and paste from another workflow of mine.

I do have one issue here though.

      - name: Create Pull Request
        # uses: repo-sync/pull-request@v2
        # use this branch temporary to support creating PR against another repo
        uses: m4heshd/pull-request@third-party-repos
        with:
          destination_repository: ${{ github.repository_owner }}/somerepo
          source_branch: ${{ env.update_branch }}
          destination_branch: nightly
          pr_title: "Update"
          pr_body: "Update with changes from ${{ github.repository }}"
          pr_assignee: ${{ secrets.GH_BOT_NAME }}
          pr_draft: false
          pr_label: "dependencies, submodules"
          pr_allow_empty: false
          github_token: ${{ secrets.GH_BOT_TOKEN }}

PR labels are not being added to the PR that's created.

Here is the created PR: LizardByte/Sunshine#603
And the logs from the workflow run with this action: https://github.com/LizardByte/build-deps/actions/runs/3754737056/jobs/6379211844#step:6:68

Note that the two labels I removed are added by another workflow... the two I specified here are not added at all.

@m4heshd
Copy link
Contributor Author

m4heshd commented Dec 22, 2022

@ReenigneArcher You can't have spaces between the labels list.

@m4heshd
Copy link
Contributor Author

m4heshd commented Dec 24, 2022

@wei Can we get this very useful PR merged? It's quite difficult to keep a 16-month-old PR up to date while resolving merge conflicts.

Copy link
Member

@wei wei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @m4heshd for helping. Merry Christmas!🎄 🎁 🎇 🥂

@wei wei merged commit d5b8353 into repo-sync:master Dec 24, 2022
@wei
Copy link
Member

wei commented Dec 24, 2022

@allcontributors add @m4heshd for code

@allcontributors
Copy link
Contributor

@wei

I've put up a pull request to add @m4heshd! 🎉

@m4heshd
Copy link
Contributor Author

m4heshd commented Dec 24, 2022

@wei Thank you for merging and Merry Christmas to you as well fellow dev. 🎄🎅🏽

@wei
Copy link
Member

wei commented Dec 24, 2022

It's now available at

repo-sync/pull-request@v2
repo-sync/[email protected]
docker://ghcr.io/repo-sync/pull-request:v2
docker://ghcr.io/repo-sync/pull-request:v2.10

This was referenced Dec 24, 2022
wei added a commit that referenced this pull request Dec 25, 2022
wei added a commit that referenced this pull request Dec 25, 2022
wei added a commit that referenced this pull request Dec 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants