-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull request title in environment variables #9288
Comments
I gave it a try: |
@BanzaiMan can these PRs be merged? There's a pretty big use case for this: right now: a project using both semantic-release and squash-and-merge github settings has no way to enforce that the commit messages that go into the master branches are in the right format. To explain:
As far as I know there is no workaround for this - the only solution is to persuade every developer to always remember to format the PRs correctly. This ends up with around 30% of PRs failing to trigger a release. @3nids changes look pretty innocent to me, and would solve a major pain-point! |
Our use case needs the pull request body, not just the commit message. We want the PR description to include hints as to which branches of related repos to check out for an integration test, e.g.
|
@sheldonh should it be updated when user modifies it? let's say I have created PR and travis runs a build for this. Then I have edited body/title and press "Restart" build. Should it be new body/title in this case? cc @BanzaiMan |
@tadjik1 Ah, that's a good point. The answer is "yes", but Travis probably shouldn't have to deal with that. I'll just deal with that in a script: I can use the PR number to fetch the body from Github. Thanks for helping me think. |
@sheldonh that's what I did as well. the problem here is that github has very strict rules about unauthorized requests. it could be simply that github returns you rate limit error and you can not resolve title and/or body. in the end I have decided to not to rely on pull request content at all, it's the only resilient way. |
travis-ci/travis-build#1319 (comment) Restart will not change this environment variable. |
I needed a way to get the PR title, eventually, I did curl to the GitHub for getting it. In the travis.yml I have added:
Then: Edit the headline and restart the travis job (by going into travis and manually restart, or by pushing a commit). |
I would like to get the pull request title in the env variables.
It is not easily accessible at the moment.
From what I could dig into, in scheduler, the worker request needs to be extended to get the PR title
https://github.com/travis-ci/travis-scheduler/blob/master/lib/travis/scheduler/serialize/worker/request.rb
and adapt the worker
https://github.com/travis-ci/travis-scheduler/blob/master/lib/travis/scheduler/serialize/worker.rb
And in build, the var needs to be added
https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/env/builtin.rb
My knowledge to pull a request my self is too low, I could not find (did not know what to look for) the way to get the PR title.
The text was updated successfully, but these errors were encountered: