Code Monkey home page Code Monkey logo

pull-request's People

Contributors

allcontributors[bot] avatar at-wat avatar cea2aj avatar christhekeele avatar christophshyper avatar goobles avatar heiskr avatar hrtshu avatar jackton1 avatar jamesmgreene avatar jamesnetherton avatar jw-maynard avatar m4heshd avatar mahmoudmabrok avatar mattcharlton avatar michalkoza avatar n3ph avatar pablobarrenechea-reflektion avatar privatenumber avatar rachmari avatar simon300000 avatar thekoenig avatar theletterf avatar wei avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pull-request's Issues

fatal: Ambiguous argument 'BRANCH_NAME': both revision and filename

Hi @repo-sync!
Thanks for the action, we are using it and it is helping us a lot.
I found an issue, probably on our end, but I would like to share it anyway.
We have a folder named prod and a branch also named prod. When we tried to trigger the action we saw that we are getting this error:

fatal: ambiguous argument 'prod': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

We noticed that adding -- in the following line https://github.com/repo-sync/pull-request/blob/master/entrypoint.sh#L37 works.
If you feel like is an issue, i can submit a PR.

Best regards,

Pablo

Is it possible to get the existing PR's ID and URLs?

I've got an interesting problem: I would like an automated process that creates PRs from one long-lived branch to another, where one PR might on occasion contain multiple changes. To help reference the changes rolled up in these PRs, I'd like to leave a comment on the existing PR.

To that end, it would be really cool if repo-sync/pull-request could find & set the existing pull request's ID/URL in output in the "fails silently if the PR already exists" case.

Currently, I have this change: antifuchs/test_repo_for_production_branch@d5e0535, which results in this output. I would love to have to not have to replicate a large part of this action's logic in order to get at that information!

Problems with self-hosted runners

There are two problems with self-hosted runners:

  1. Every run creates a new docker image.
  2. A container is run as root user, that causes some problems with the files in future runs

The first problem is solved by building a docker image and referencing it in a workflow:

- name: 'Create pull request'
  uses: docker://ghcr.io/tegorov/pull-request:v2.6.2
  with:
     source_branch: develop
  ...

The second problem is solved by passing USER_ID parameter in a container:

- name: 'Create pull request'
  uses: docker://ghcr.io/tegorov/pull-request:v2.6.2
  with:
     source_branch: develop
     ...
  env:
     USER_ID: 1000

Here is my pull request as an example #90

Question: does it support team names in the pr_reviewer field?

Hello, our team is using this GH action and we were wondering if it works when using a GH team name in the pr_reviewer field. We have tried but it doesn't appear to be working. Do we need to include anything special to do this?

our org name is something like "abcinc"
our team name is something like "cool-team"

we tried:

pr_reviewer: "some-person-account,cool-team"

as well as:

pr_reviewer: "some-person-account,abcinc/cool-team"

But they don't seem to be working. Any suggestions or is this a feature request?

can destination_branch works with regex ?

I tried like this destination_branch: '${{env.GIT_BRANCH_NAME}}*' but got this error: fatal: bad revision 'release-v1*'
${{env.GIT_BRANCH_NAME}} = release-v1
I'm looking to get destination branch that name is 'release-v1.1'

Action fails to run with `fatal: bad revision` error being thrown

Currently when CI runs it fails with a fatal: bad revision 'refs/pull/351/merge' error. This seems strange because every other workflow that is ran such as our build workflow doesn't have any issues, only this workflow and specifically only the repo-sync/pull-request step of this wokflow fail.

Here is an outline of the failing workflow:

name: Pull Request

on:
  pull_request:
    branches: [master]

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
      - uses: toshimaru/[email protected]
        with:
          repo-token: ${{ secrets.GH_TOKEN }}
      - uses: atlassian/gajira-login@master
        env:
          JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
          JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
          JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
      - uses: atlassian/gajira-find-issue-key@master
        id: jira-issue-number
        with:
          from: branch
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: repo-sync/pull-request@v2
        with:
          pr_title: "Omitted"
          pr_body: "Omitted"
          pr_reviewer: "Omitted"
          pr_label: "Omitted"
          github_token: ${{ secrets.GH_TOKEN }}

All the other steps pass fine as you can see here:

Bildschirmfoto 2021-07-05 um 15 03 32

Any help would be much appreciated!

Make PR to a different repo

Thanks a lot for sharing this action!

I am trying to use it in a workflow to make a PR to a different repo. Specifically, I am trying to set up a workflow to make a PR to update a submodule in a different repo whenever the submodule target repo is changed.

The repo where the action is running is pangeo-gallery/example-gallery (the target of the submodule), while the repo where the submodule lives is pangeo-gallery/pangeo-gallery

I am getting this error:

warning: no common commits
From https://github.com/pangeo-gallery/example-gallery
 * [new branch]      binderbot-built -> binderbot-built
 * [new branch]      github-actions  -> github-actions
 + 84b9a01...bfc1e8d master          -> master  (forced update)
 * [new branch]      binderbot-built -> origin/binderbot-built
 * [new branch]      github-actions  -> origin/github-actions
 + 84b9a01...bfc1e8d master          -> origin/master  (forced update)
hub pull-request   -b master   -h binderbot-update   --no-edit   -m "Update pangeo-gallery/example-gallery submodule" -m ":crown: *An automated PR*"   || true
Error creating pull request: Unprocessable Entity (HTTP 422)
Invalid value for "head"

It looks like the action is trying to make the PR from pangeo-gallery/example-gallery, rather than pangeo-gallery/pangeo-gallery. I would like it to come from pangeo-gallery/pangeo-gallery, which I have already checked out earlier in my workflow.

Is this possible?

My workflow is here:
https://github.com/pangeo-gallery/example-gallery/blob/master/.github/workflows/pangeo-gallery.yaml

You can see the log here:
https://github.com/pangeo-gallery/example-gallery/runs/515467109?check_suite_focus=true#step:6:11

failed with refusing to fetch...

    - uses: actions/checkout@v1
      with:
        ref: develop
    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        source_branch: develop
        destination_branch: master
        pr_label: automerge
        github_token: ${{ secrets.GITHUB_TOKEN }}

fails with:

##[error]Docker run failed with exit code 128
Run repo-sync/pull-request@v2
/usr/bin/docker run --name e4e3a6913e7162e7d458b897f452bfbccfa89_b5ac7c --label 2e4e3a --workdir /github/workspace --rm -e INPUT_SOURCE_BRANCH -e INPUT_DESTINATION_BRANCH -e INPUT_PR_LABEL -e INPUT_GITHUB_TOKEN -e INPUT_PR_TITLE -e INPUT_PR_BODY -e INPUT_PR_REVIEWER -e INPUT_PR_ASSIGNEE -e INPUT_PR_MILESTONE -e GITHUB_TOKEN -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/nasawds-2.0/nasawds-2.0":"/github/workspace" 2e4e3a:6913e7162e7d458b897f452bfbccfa89
fatal: Refusing to fetch into current branch refs/heads/develop of non-bare repository
##[error]Docker run failed with exit code 128

Any ideas?

Refusing to fetch into current branch

Hello i have an error when the action is trigger :
Screenshot_20200219_150827

step :

  1. create branch "test-auto-pr" from branch "develop"
  2. create file touch delete.me
  3. commit the file
  4. push git push origin test-auto-pr
  5. the job is trigger but is failed

My .yml :

name: Create Pull Request
on:
  push:
    branches:
    - "*"
    - "!develop"
    - "!master"

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        destination_branch: "develop"          # If blank, default: master
        pr_title: "${{github.actor}} triger auto pr : ${{ github.ref }} into develop"
        pr_body: "📡 *An automated PR*"  # Full markdown support, requires pr_title to be set
        pr_reviewer: "bouteillerAlan"             # Comma-separated list (no spaces)
        pr_assignee: "bouteillerAlan"             # Comma-separated list (no spaces)
        pr_label: "auto-pr"                   # Comma-separated list (no spaces)
        github_token: ${{ secrets.GITHUB_TOKEN }}

Create Setting for Output Verbosity and Better Echo's for Debugging

Firstly, thanks guys and girls for this action. Been really enjoying using it! Just a small request: when trying to work out what went wrong during implementation the verbosity from the following line, made it very difficult to find out what was going on.

git --no-pager branch -a -vv

Can I suggest an optional flag here?

Can I also suggest an echo within the following if clause: It just makes debugging a great deal easier!

if [[ "$?" != "0" ]]; then
exit 1
fi

fatal: bad revision 'master' when using distribution branch 'develop'

Hi,

I am getting fatal: bad revision 'master' even I have distribution branch set to 'develop', I am using v2.6.1.

Where is this coming from?

From https://github.com/netSkope/ep-versioner

  • 3707dc4...7810b7e develop -> develop (forced update)
  • [new branch] update_repo_enrichment@355fdb36aabe784b27eb7e05015f365e904b153a -> update_repo_enrichment@355fdb36aabe784b27eb7e05015f365e904b153a
  • [new branch] update_repo_enrichment@355fdb36aabe784b27eb7e05015f365e904b153a -> origin/update_repo_enrichment@355fdb36aabe784b27eb7e05015f365e904b153a
  • [new tag] v0.0.2 -> v0.0.2
  • [new tag] v0.0.3 -> v0.0.3
  • [new tag] v0.1.0 -> v0.1.0
    develop 7810b7e [origin/develop] EP-11524: Update repo enrichments to 9cefce348cb5eafa5f95ca6fbec3cb93102f504b (#26)
    update_repo_enrichment@355fdb36aabe784b27eb7e05015f365e904b153a 0622028 EP-11524: Update repo enrichments to 355fdb36aabe784b27eb7e05015f365e904b153a
  • update_repo_enrichment@79100a1e7a1e303d0459cf2d33bfb83f1d6ddaa4 3707dc4 [origin/update_repo_enrichment@79100a1e7a1e303d0459cf2d33bfb83f1d6ddaa4] EP-11524: Update repo enrichments to 79100a1e7a1e303d0459cf2d33bfb83f1d6ddaa4
    remotes/origin/develop 7810b7e EP-11524: Update repo enrichments to 9cefce348cb5eafa5f95ca6fbec3cb93102f504b (#26)
    remotes/origin/update_repo_enrichment@355fdb36aabe784b27eb7e05015f365e904b153a 0622028 EP-11524: Update repo enrichments to 355fdb36aabe784b27eb7e05015f365e904b153a
    remotes/origin/update_repo_enrichment@79100a1e7a1e303d0459cf2d33bfb83f1d6ddaa4 3707dc4 EP-11524: Update repo enrichments to 79100a1e7a1e303d0459cf2d33bfb83f1d6ddaa4
    fatal: bad revision 'master'

Using title of the original pr

Is it possible to reference the title of the original pr?

I wanted to do something like pr_title: "Pulling ${{ pr_title }} into master"

Double Quotes in `pr_body` break string

    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - uses: repo-sync/pull-request@v2
        with:
          github_token: ${{ secrets.PAT }}
          pr_title: "⤴️ ${{ github.actor }} Draft Merge Request"
          pr_body: |
            :arrow_heading_up: Closes: #issueid <!-- your issue -->

            **Describe the Change** <!-- A longer description  -->
            "Put a description here"
          pr_draft: true

Expected: PR body is complete
Actual: PR body cuts off at Put, without the quotation marks

I think the cause for this is the arg building for hub which doesn't have any double quote protection. Unfortunately, there's not much that can be done. Either the pr_body allows ${{ expressions }}, or it has to require " to be escaped. The current behavior requires " to be escaped, at which point we may just want to update the readme.

Subsequent workflows will not be executed.

hi there.

I created a workflow using this actions, but the workflow I already created is no longer executed.

Workflow that is executed when pull_request is created in develop and main. An example is shown below.

name: example

on:
  workflow_run:
    workflows: ["Create Pull Request"]
    types:
      - completed
  pull_request:
    branches:
      - main
      - develop

jobs:
...

The workflow using repo-sync/pull-request looks like this.

name: Create Pull Request

on:
  push:
    branches:
      - feature/*

jobs:
  create-pull-request:
    name: create-pull-request
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Create Pull Request
        id: open-pr
        uses: repo-sync/pull-request@v2
        with:
          destination_branch: "develop"
          pr_title: "[example] test_summary"
          pr_body: "test body."
          github_token: ${{ secrets.GITHUB_TOKEN }}

If you know any solution, please let me know.

I look forward to working with you : )

Pure JS imeplementation?

We are using self-hosted runners, and repo-sync/pull-request@v2 uses Docker image to create a intermediate docker image to run it. After a some period of time we are experiencing storage issues because of intermediate images.

Is it possible to provide a JS implementation, in order to avoid image creation?

Is their a way to configure the PR author

Right now we use this action internally on a repo to test how it works but we noticed that the person who pushes the code is not the PR author once it is generated, instead that will be the person who the GITHUB_TOKEN belongs to. How can we make the person who pushed the code the author of the PR also?

Pull request number as output

👋 Hey! Small feature request, it'd be great to be able to get just the created PR number in subsequent steps, instead of just the url.

Can I have the github-actions bot be the actor?

Hi,
I was wondering if it is possible to have the github-actions bot be the one who creates the PR and adds the labels to it.
Currently it just uses my own name...

image

image

Anyone have an idea on how I can achieve this?

Ability to re-request review

Is it possible to automatically trigger "Re-request review" in case that PR was approved by reviewer but new code was committed after approval and before merging?

For example, my .yml file has following configuration:

on:
  push

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: pull-request
        uses: repo-sync/pull-request@v2
        with:
          destination_branch: "develop"
          pr_title: "${{github.actor}} - Pulling ${{ github.ref }} into develop"
          pr_reviewer: "bomb-on"
          pr_assignee: "bomb-on"
          pr_label: "auto-pr"
          github_token: ${{ secrets.GITHUB_TOKEN }}

Let's say that one of the repository contributors creates a new feature branch and pushes it:

git flow feature start 'test-feature-1'
echo "feature1" > feature1
git add .
git commit -m "First Feature"
git push --set-upstream origin feature/test-feature-1

The PR will be created and assigned for review. I do review and approve it but I don't merge it immediately. At this point, same user updates the same branch, e.g.:

echo "update" >> feature1
git add .
git commit -m "First Feature Update"
git push

This commit will end up in the same PR and I can see that there has been changes in GitHub's PR page:
Screenshot 2019-11-08 at 14 04 14
but it won't trigger "Re-request review" and it will look like updated code has been reviewed and whole PR approved.

So, is it possible to somehow automatically trigger this "Re-request review" in such case?

fatal: unsafe repository ('/github/workspace' is owned by someone else)

Hello and thank you for this action. Although I am using the same workflow in a different repository in the same organization, I am having an interesting error in a single repository. Here is my workflow and the error that I am having. Any idea what might be going on?

fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

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

image

name: auto create PR to develop
on:
  pull_request:
    branches:
      - main
    types:
      - closed

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: pull-request
        if: github.event.pull_request.merged == true
        uses: repo-sync/pull-request@v2
        with:
          source_branch: ${{ github.head_ref }}
          destination_branch: "develop"
          pr_title: ${{ format('Auto PR from {0}', github.head_ref) }}
          pr_allow_empty: false
          github_token: ${{ secrets.GITHUB_TOKEN }}

PR URL output

I have a use case where I need the PR URL for a subsequent steps in the workflow, but I cannot find any actions that provide that as an output. Would it be possible to provide the URL of the PR as an output from the action?

How to close the old PR or update the title

I am using this to open PR again production branch which has the short sha of the latest commit.

Most fo the time the PR is already open and the title has old hash value, how can I close old PR and create a new or change only the title of the opened PR?

GITHUB_TOKEN permissions used by this action

At https://github.com/step-security/secure-workflows we are building a knowledge-base (KB) of GITHUB_TOKEN permissions needed by different GitHub Actions. When developers try to set minimum token permissions for their workflows, they can use this knowledge-base instead of trying to research permissions needed by each GitHub Action they use.

Below you can see the KB of your GITHUB Action.

name: GitHub Pull Request Action
github-token:
  action-input:
    input: github_token
    is-default: false
  permissions:
    pull-requests: write
    pull-requests-reason: to create pull requests #Checkout: https://github.com/repo-sync/pull-request#features

#Fixes #497

If you think this information is not accurate, or if in the future your GitHub Action starts using a different set of permissions, please create an issue at https://github.com/step-security/secure-workflows/issues to let us know.

This issue is automatically created by our analysis bot, feel free to close after reading :)

References:

GitHub asks users to define workflow permissions, see https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/ and https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token for securing GitHub workflows against supply-chain attacks.

Setting minimum token permissions is also checked for by Open Source Security Foundation (OpenSSF) Scorecards. Scorecards recommend using https://github.com/step-security/secure-workflows so developers can fix this issue in an easier manner.

Is this action compatible with the private repository?

Hey Guys,

I am using this action on my private repository but it seems there are some errors in the processing like below:

Error creating pull request: Not Found (HTTP 404)
Not Found
Are you sure that github.com/SharryXu/blog exists?

Do you guys have any ideas? Maybe I need to add more options when creating the PAT?

Allow team reviewers

Is it possible to add an option to specify an organization team to the pr_reviewer option?

Create new branch for merge

Hi! 👋 Great action, thank you for making it.

We have a situation where our development branch only allows squash merges, and our main branch cannot be committed to directly. When we create a pull request from main -> development and there's any conflict, we cannot fix the conflict and have to manually create another pull request.

Would you accept a PR to add a feature to create an intermediary branch? Something like:

    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        destination_branch: ${{ env.TARGET }}
        branch_name: ${{ env.BRANCH_NAME }}  # 🆕 Add input for branch name

This would create a branch from source_branch named branch_name that targets destination_branch.

The script would simply create the branch name from the source branch and push it before running the hub command.

Team_reviewer is throwing a HTTP 422 error

Hi, i'm trying to add the team as a reviewer but is not picking it up

I've tried pr_reviewer: "team-prs" pr_reviewer: "/team-prs" pr_reviewer: "@org/team-prs" pr_reviewer: "org/team-prs"

and it shows an error Error requesting reviewer: Unprocessable Entity (HTTP 422)

any ideas?

source and destination branches are the same but not

I'm trying to use this action to auto create a PR triggered off a branch name into master, basically the exact same example given in the docs. However, when the action runs, it says the Source and destination branches are the same. and does not create the PR. I'm trying to trigger from source branch dm_update_tree to destination branch master. My workflow looks like the following:

name: Add New Paths

on:
  push:
    branches:
      - dm_update_tree

jobs:
  createpr:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Create Pull Request
        id: open-pr
        uses: repo-sync/pull-request@v2
        with:
          source_branch: ""
          destination_branch: "master"
          pr_title: "New tree paths"
          pr_body: ":crown: *An automated PR*"
          pr_reviewer: "havok2063"
          pr_label: "auto-pr,enhancement"
          pr_draft: true
          github_token: ${{ secrets.GITHUB_TOKEN }}

      - name: Output PR URL
        run: echo ${{steps.open-pr.outputs.pr_url}}
      - name: Output PR Number
        run: echo ${{steps.open-pr.outputs.pr_number}}

Refusing to fetch into current branch [...] of non-bare repository

Hi. I'm getting: fatal: Refusing to fetch into current branch [...] of non-bare repository

For clean repository it happens for example when I run actions/checkout@v2. Works only for actions/checkout@v1.

But when I make some changes to files, want to push it to a new branch and then create pull request from it it's happening again. So basically when current local branch is not equal to GIT_REF.

How can this be solved? Any ideas?

Subsequent Workflows Don't Execute when NOT USING secrets.GITHUB_TOKEN

We use the https://github.com/tibdex/github-app-token to generate a token so we can have a workflow trigger another workflow etc etc.

However when we use that generated token with this PR Action it creates the PR but none of the workflows are triggered for that PR, it's as if it used the secrets.GITHUB_TOKEN somehow and not the one generated in the generate-token step. We use that generate token process in other workflows without issues, this is the first time we are using it in a workflow that was already using this PR action.

We even created a personal access token, just to test this, and the same thing happens with this action it creates the PR but non of the workflows for the PR run.

We have a step like this:

- name: Generate Token
   uses: tibdex/github-app-token@v1
   id: generate-token
   with:
     app_id: ${{ secrets.GENERATED_TOKEN_APP_ID }}
      private_key: ${{ secrets.GENERATED_TOKEN_APP_PRIVATE_KEY }}  

Then we run the PR action like this:

- name: Create Pull Request
   id: open-pr
   uses: repo-sync/pull-request@v2
   with:
     source_branch: ${{ steps.release_name.outputs.branch }}
     destination_branch: master
     pr_title: Release ${{ steps.release_name.outputs.name }}
     pr_body: ${{ steps.read_file.outputs.contents}}
     pr_label: release
     github_token: ${{ steps.generate-token.outputs.token }}

Error when running on self-hosted

When I run this action on self-hosted runner, I get the following error:

Run repo-sync/pull-request@v2
/usr/bin/docker run --name cd3395d146bea0da2d51c305be69_a232a7 --label 765292 --workdir /github/workspace --rm -e INPUT_SOURCE_BRANCH -e INPUT_DESTINATION_BRANCH -e INPUT_PR_TITLE -e INPUT_PR_BODY -e INPUT_PR_LABEL -e INPUT_GITHUB_TOKEN -e INPUT_PR_TEMPLATE -e INPUT_PR_REVIEWER -e INPUT_PR_ASSIGNEE -e INPUT_PR_MILESTONE -e INPUT_PR_DRAFT -e INPUT_PR_ALLOW_EMPTY -e GITHUB_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/opt/actions-runner/_work/_temp/_github_home":"/github/home" -v "/opt/actions-runner/_work/_temp/_github_workflow":"/github/workflow" -v "/opt/actions-runner/_work/test-github-actions/test-github-actions":"/github/workspace" 765292:2070cd3395d146bea0da2d51c305be69
fatal: not a git repository (or any parent up to mount point /github)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Could you, please, tell, what the problem may it be with?

Line break with checkboxes

Hi guys

How can I force a line break to get this

My text and then my checkbox

  • my checkbox

I was trying with \ with <br/> but I can't generate a proper line break that render a checkbox

My results:
with \
image

with <br/>
image

thanks for the action! <3

could not find any git remote pointing to a GitHub repository

Hi!

I'm experiencing this error when running the action:

could not find any git remote pointing to a GitHub repository

The action reports success but a PR is not created - I have noticed that if I re-run the job from the UI it is successful and creates the PR.

Below is a snippet of my configuration and logs

jobs:
  pull-request:
    name: Open PR to main
    runs-on: ubuntu-18.04
    steps:
    - uses: actions/checkout@v2
      name: checkout

    - uses: repo-sync/pull-request@v2
      name: pull-request
      with:
        destination_branch: "main"
        pr_title: "Pulling ${{ github.ref }} into main"
        pr_body: "👑 *An automated PR*"
        pr_reviewer: "craigbryson"
        pr_draft: true
        github_token: ${{ secrets.GITHUB_TOKEN }}
From https://github.com/myOrg/myRepo
11
 * [new branch]      main       -> main
12
 * [new branch]      main       -> origin/main
13
* core-image-updates                3cf280d [origin/core-image-updates] **Automated image update**
14
  main                                   26fbf22 Update nginx-ingress.yaml
15
  remotes/origin/core-image-updates 3cf280d **Automated image update**
16
  remotes/origin/main                    26fbf22 Update nginx-ingress.yaml
17
hub pull-request   -b main   -h core-image-updates   --no-edit   -m "Pulling refs/heads/core-image-updates into main" -m "👑 *An automated PR*" -r "craigbryson" -d   || true
18
Aborted: could not find any git remote pointing to a GitHub repository 

Am I going wrong somewhere?

Completing successfully even with failure on hub remote request.

When using github job specific permissions and not allowing pr writes, this action should error.

I believe the issue is here:
https://github.com/repo-sync/pull-request/blob/master/entrypoint.sh#L84

Using || true will allow this command to succeed even during failure?

To recreate:

  1. Make default action permission in repo = read-only
    Settings -> Actions -> Workflow permissions -> Read repository contents permission

  2. Run action with repo-sync/pull-request
    No PR created, but action succeeds with message like

hub pull-request   -b master   -h branchybranchy   --no-edit   -m "some message" || true
Error creating pull request: Forbidden (HTTP 403)
Resource not accessible by integration
  1. Add permission to write pr's into action.yaml
jobs:
  create-pr:
    name: "create some PR"
    permissions:
      pull-requests: write   
    ...
  1. Run action again, with successful pr creation.
hub pull-request   -b master   -h branchybranchy   --no-edit   -m "some message" || true
https://github.com/loosebazooka/testtest/pull/16

Always "No file changes detected" on v2.4.2

The action doesn't create PR even if there are commits between destination and source branch.

No file changes detected between source and destination branches.

It looks be caused by #43 which changed diff command to

git diff --name-only -- "$DESTINATION_BRANCH" "$SOURCE_BRANCH"

Below shows the change of the behavior by #43:

$ git init
Initialized empty Git repository in /tmp/pull-request/.git/

# Add a.txt to master branch
$ touch a.txt; git add a.txt; git commit -m "Add a.txt"
[master (root-commit) 5bd1d04] Add a.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a.txt

# Create the-branch and add b.txt, then master and the-branch should have diff
$ git checkout -b the-branch
Switched to a new branch 'the-branch'
$ touch b.txt; git add b.txt; git commit -m "Add b.txt"
[the-branch 27ce7e0] Add b.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 b.txt
$ DESTINATION_BRANCH=master
$ SOURCE_BRANCH=the-branch

# This is the script after #43 and LINES_CHANGED is 0 (**incorrect**)
$ LINES_CHANGED=$(git diff --name-only -- "$DESTINATION_BRANCH" "$SOURCE_BRANCH" | wc -l | awk '{print $1}')
$ echo $LINES_CHANGED 
0

# This is the script before #43 and LINES_CHANGED is 1 (**correct**)
$ LINES_CHANGED=$(git diff --name-only "$DESTINATION_BRANCH" "$SOURCE_BRANCH" | wc -l | awk '{print $1}')
$ echo $LINES_CHANGED 
1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.