{"action":"created","issue":{"url":"https://api.github.com/repos/ashwanthkumar/gocd-build-github-pull-requests/issues/105","repository_url":"https://api.github.com/repos/ashwanthkumar/gocd-build-github-pull-requests","labels_url":"https://api.github.com/repos/ashwanthkumar/gocd-build-github-pull-requests/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/ashwanthkumar/gocd-build-github-pull-requests/issues/105/comments","events_url":"https://api.github.com/repos/ashwanthkumar/gocd-build-github-pull-requests/issues/105/events","html_url":"https://github.com/ashwanthkumar/gocd-build-github-pull-requests/issues/105","id":238566330,"number":105,"title":"PR environment variables not available during build process","user":{"login":"volodymyr-mykhailyk","id":712680,"avatar_url":"https://avatars3.githubusercontent.com/u/712680?v=4","gravatar_id":"","url":"https://api.github.com/users/volodymyr-mykhailyk","html_url":"https://github.com/volodymyr-mykhailyk","followers_url":"https://api.github.com/users/volodymyr-mykhailyk/followers","following_url":"https://api.github.com/users/volodymyr-mykhailyk/following{/other_user}","gists_url":"https://api.github.com/users/volodymyr-mykhailyk/gists{/gist_id}","starred_url":"https://api.github.com/users/volodymyr-mykhailyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volodymyr-mykhailyk/subscriptions","organizations_url":"https://api.github.com/users/volodymyr-mykhailyk/orgs","repos_url":"https://api.github.com/users/volodymyr-mykhailyk/repos","events_url":"https://api.github.com/users/volodymyr-mykhailyk/events{/privacy}","received_events_url":"https://api.github.com/users/volodymyr-mykhailyk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-06-26T14:44:13Z","updated_at":"2017-10-17T11:38:22Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nmaybe it is a configuration issue, but I don't see any environment variables mentioned in description during build process.\r\n\r\nThe only item I can see is special is that:\r\n- we using YAML configuration plugin\r\n- we using custom named scm materials\r\n\r\nHere is piece of yaml configuration:\r\n```YAML\r\nmaterials:\r\n  repo:\r\n    scm: repo-name.pull-requests\r\n    destination: repo\r\n  ci-scripts:\r\n    pipeline: ops-builds.ci-scripts\r\n    stage: build\r\n```\r\n\r\nHere is list of environment variables set by GOCD during build process:\r\n```\r\n14:29:17.443 [go] Start to update materials.\r\n14:29:35.390 [go] overriding environment variable 'GO_SERVER_URL' with value 'https://****:8154/go'\r\n14:29:35.390 [go] setting environment variable 'GO_TRIGGER_USER' to value 'changes'\r\n14:29:35.390 [go] setting environment variable 'GO_PIPELINE_NAME' to value 'repo-name.build--pull-requests'\r\n14:29:35.390 [go] setting environment variable 'GO_PIPELINE_COUNTER' to value '4'\r\n14:29:35.390 [go] setting environment variable 'GO_PIPELINE_LABEL' to value '8f7b322c9c'\r\n14:29:35.390 [go] setting environment variable 'GO_STAGE_NAME' to value 'build'\r\n14:29:35.390 [go] setting environment variable 'GO_STAGE_COUNTER' to value '1'\r\n14:29:35.390 [go] setting environment variable 'GO_JOB_NAME' to value 'build_docker_image'\r\n14:29:35.390 [go] setting environment variable 'GO_DEPENDENCY_LABEL_CI_SCRIPTS' to value '16'\r\n14:29:35.390 [go] setting environment variable 'GO_DEPENDENCY_LOCATOR_CI_SCRIPTS' to value 'ops-builds.ci-scripts/16/build/1'\r\n14:29:35.390 [go] setting environment variable 'GO_SCM_REPO_LABEL' to value '8f7b322c9c408eed89f356808e6d18450efc8446'\r\n14:29:35.390 [go] setting environment variable 'GO_SCM_REPO_URL' to value 'git@github.com:******.git'\r\n14:29:35.390 [go] setting environment variable 'GO_SCM_REPO_PR_ID' to value '1543'\r\n\r\n14:29:35.761 [go] Start to build repo-name.build--pull-requests/8f7b322c9c/build/1/build_docker_image on 89c6dcc038f9 [/go]\r\n```\r\n\r\nAny hints why we don't see target branch environment variables?\r\n\r\nThanks in advance"},"comment":{"url":"https://api.github.com/repos/ashwanthkumar/gocd-build-github-pull-requests/issues/comments/337203885","html_url":"https://github.com/ashwanthkumar/gocd-build-github-pull-requests/issues/105#issuecomment-337203885","issue_url":"https://api.github.com/repos/ashwanthkumar/gocd-build-github-pull-requests/issues/105","id":337203885,"user":{"login":"mukeshmurali","id":445197,"avatar_url":"https://avatars1.githubusercontent.com/u/445197?v=4","gravatar_id":"","url":"https://api.github.com/users/mukeshmurali","html_url":"https://github.com/mukeshmurali","followers_url":"https://api.github.com/users/mukeshmurali/followers","following_url":"https://api.github.com/users/mukeshmurali/following{/other_user}","gists_url":"https://api.github.com/users/mukeshmurali/gists{/gist_id}","starred_url":"https://api.github.com/users/mukeshmurali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mukeshmurali/subscriptions","organizations_url":"https://api.github.com/users/mukeshmurali/orgs","repos_url":"https://api.github.com/users/mukeshmurali/repos","events_url":"https://api.github.com/users/mukeshmurali/events{/privacy}","received_events_url":"https://api.github.com/users/mukeshmurali/received_events","type":"User","site_admin":false},"created_at":"2017-10-17T11:38:22Z","updated_at":"2017-10-17T11:38:22Z","author_association":"NONE","body":"I am facing the same issue. Any help is really appreciated:\r\n\r\nFollowing are the details:\r\n\r\n```\r\nGo Version: 17.1.0 \r\nGithub PR Builder plugin version: 1.3.4 \r\n```\r\n\r\nAvailable variables:\r\n\r\n```\r\nsetting environment variable 'GO_PIPELINE_NAME' to value 'xxxxx'\r\nsetting environment variable 'GO_PIPELINE_COUNTER' to value '71'\r\nsetting environment variable 'GO_PIPELINE_LABEL' to value 'xxxx'\r\nsetting environment variable 'GO_STAGE_NAME' to value 'xxxxx'\r\nsetting environment variable 'GO_STAGE_COUNTER' to value '1'\r\nsetting environment variable 'GO_JOB_NAME' to value 'xxxxx'\r\nsetting environment variable 'GO_SCM_GS_CONSOLE_PR_LABEL' to value 'xxxxx'\r\nsetting environment variable 'GO_SCM_GS_CONSOLE_PR_URL' to value 'git@github.xxxxxxx'\r\nsetting environment variable 'GO_SCM_GS_CONSOLE_PR_PR_ID' to value '100'\r\n```\r\n\r\nThere are no errors in the plugin logs. \r\n\r\nThe only error in the server logs is the below that is safe to be ignored as per the below post\r\nhttps://github.com/ashwanthkumar/gocd-slack-build-notifier/issues/43\r\n\r\n\r\nThe gocd server has .github file present in the home folder of the go user with the content as below:\r\n```\r\n# for enterprise installations - Make sure to add /api/v3 to the hostname\r\n# ignore this field or have the value to https://api.github.com\r\nendpoint=https://<github host name>/api/v3\r\nlogin=johndoe\r\noauth=thisaintatoken\r\n```\r\n"}}
{"actor":{"display_login":"mukeshmurali"}}