Comments (10)
For anyone who finds this in the future, you want DRONE_SOURCE_BRANCH.
from go-scm.
nope, DRONE_COMMIT_BRANCH has always been the target branch, including in 0.8. In 1.0 we also provide more explicit values DRONE_SOURCE_BRANCH and DRONE_TARGET_BRANCH
from go-scm.
Hmmm, I am unable to reproduce this issue (drone 1.0.0-rc.5). The mapping of source and target branch for merge request for GitLab can be found here:
https://github.com/drone/go-scm/blob/master/scm/driver/gitlab/webhook.go#L244:L245
from go-scm.
Here's a screenshot of the build log. I don't see this for builds triggered by pushes. It's only for ones triggered by merge events. Are there any logs I can push up here that might be useful?
from go-scm.
Small update.
Appears to be working as intended.
from go-scm.
@bradrydzewski So, we agree that DRONE_COMMIT_BRANCH
should refer to source branch (as in 0.8), right?
from go-scm.
DRONE_COMMIT_BRANCH has always been the target branch, including in 0.8
I don't think so: https://github.com/drone/drone/blob/768ed784bd74b0e0c2d8d49c4c8b6dca99b25e96/remote/gitlab/gitlab.go#L530
from go-scm.
for GitHub and other providers it was target branch. If GitLab were using source branch previously it was a bug. The 1.0 implementation is the desired state.
from go-scm.
for GitHub and other providers it was target branch.
But IMO, it should be source branch, as target branch often is master
.
The question is: Is there any env that we can use to refer to the source branch (for both push
and pull_request
events)?
from go-scm.
yes, you can use DRONE_SOURCE_BRANCH for push and pull_request events.
from go-scm.
Related Issues (20)
- Bitbucket Stash driver doesn't handle event `pr:from_ref_updated` (new commits / force push) HOT 1
- Fix dump response
- PullRequest.Fork field is unintended content
- gitea find commit HOT 2
- Any plans to support manage wehook HOT 2
- The deprecation of Bitbucket API endpoint /2.0/teams breaks user registration HOT 2
- Request to support creating a webhook with the scope all
- [Proposal] add search interface for go-scm
- When attempting to clone my git repo from GitLab drone hangs on git fetch. HOT 3
- Broken pagination function of Stash provider HOT 4
- gitee client pagination bug HOT 2
- file naming conventions
- Gitea `ListChanges` and `CompareChanges` HOT 1
- proposal: gitea: push webhook: pass commit added / removed / modified files list data HOT 1
- gitee: When the name and path are inconsistent, got 404 error HOT 4
- gitlab: force_remove_source_branch type is inconsistent HOT 2
- Gogs commit fails to deserialize commitDetails in some cases HOT 4
- (missing feature) add support to check organization membership in gitea driver
- Replace deprecated Bitbucket Stash build status endpoint
- Cron Jobs don't run with Gitea-scm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-scm.