github-integration-plugin icon indicating copy to clipboard operation
github-integration-plugin copied to clipboard

Incorrect value of $GITHUB_PR_SOURCE_BRANCH

Open facos86 opened this issue 8 years ago • 8 comments

Hi, In the one of the latest update, the variable GITHUB_PR_SOURCE_BRANCH becames incorrect and now always return "master" Other values like GITHUB_PR_NUMBER are correct.

Configuration : Cron with persisted data

facos86 avatar Mar 15 '17 16:03 facos86

Do you use latest available version?

KostyaSha avatar Mar 15 '17 16:03 KostyaSha

Yes, Plugin version : GitHub Integration Plugin for Jenkins 0.1.0-rc22

facos86 avatar Mar 15 '17 16:03 facos86

Could you check what is available in repository xml near job's config.xml? Plugin stores the last known state in this storage.

KostyaSha avatar Mar 15 '17 16:03 KostyaSha

Do you mean the runtime xml ?

<?xml version='1.0' encoding='UTF-8'?>
<org.jenkinsci.plugins.github.pullrequest.GitHubPRRepository plugin="[email protected]">
  <fullName>GitHubRepositoryName[host=https://XXX/<,username=XXX/<,repository=XXX]</fullName>
  <githubUrl>https://XXX/</githubUrl>
  <gitUrl>git://XXX</gitUrl>
  <sshUrl>XXX</sshUrl>
 <pulls>
    <entry>
      <int>1987</int>
      <org.jenkinsci.plugins.github.pullrequest.GitHubPRPullRequest>
        <number>1987</number>
        <issueUpdatedAt>2017-03-13 16:48:29.0 UTC</issueUpdatedAt>
        <title>XXX</title>
        <body></body>
        <prUpdatedAt>2017-03-13 16:48:29.0 UTC</prUpdatedAt>
        <headSha>36c9dd1a027014c8a6aca82153053c5b0b3f3</headSha>
        <headRef>r-dav-test-v1</headRef>
        <mergeable>true</mergeable>
        <baseRef>master</baseRef>
        <userLogin>david</userLogin>
        <htmlUrl>https://XXX</htmlUrl>
        <labels/>
        <sourceRepoOwner>XXX</sourceRepoOwner>
        <state>OPEN</state>
        <inBadState>false</inBadState>
      </org.jenkinsci.plugins.github.pullrequest.GitHubPRPullRequest>
    </entry>


facos86 avatar Mar 15 '17 17:03 facos86

I have a similar issue, but for me GITHUB_PR_TARGET_BRANCH is not correct after switching the base branch in a PR.

winterDroid avatar May 28 '18 15:05 winterDroid

I have a similar issue, but for me GITHUB_PR_TARGET_BRANCH is not correct after switching the base branch in a PR.

AFAIR it was new github feature, need check code wether it renew this information for PR data.

KostyaSha avatar May 28 '18 22:05 KostyaSha

Synchronization issues were fixed long time ago, does this issue still exist?

KostyaSha avatar Feb 09 '19 02:02 KostyaSha

Still exists....

chenliu1993 avatar Feb 21 '23 06:02 chenliu1993