question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Semaphore - Might need disclaimer

See original GitHub issue

Not sure where the docs for this page are located, otherwise I would have just done a PR: http://danger.systems/js/guides/getting_started.html

The semaphore integration works, but there’s a catch. Semaphore won’t do a PR build unless it’s a fork. So anyone who owns the repo, and simply does branch PRs, will see this message: image

I wrote to Semaphore and they responded with the following:

After a project has been added, Semaphore builds branches that are created within the repository.
 Because of this, at the moment Semaphore doesn't support building pull requests that are opened 
within the same repository. Opening a PR will trigger a build only if it was opened from a fork. For 
more details please refer to this page. 

Good news is that adding the option for building pull requests within repository is on our roadmap. 
So, we'd really appreciate if you have few moments to describe your use-case. We don't have an 
ETA yet, but we expect to deliver this feature during the first half of 2018. 

I believe a caveat should be added to the docs (I personally moved danger-js to Travis for this reason). But then again, maybe danger JS should detect semaphore and be willing to skip the detection process?

I hope this helps ^

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Elecwebcommented, Mar 5, 2019

Have any updated ? I also have this problem. Do you have workaround for this one ?

0reactions
besseycommented, Oct 30, 2019

Here’s your workaround https://semaphoreci.com/docs/how-to-fetch-pull-request-number-from-github.html

Edit: These docs are outdated, but it does work with changes

#!/bin/env ruby

# Necessary for Danger to work in Semaphore -_-' see:
# https://semaphoreci.com/docs/how-to-fetch-pull-request-number-from-github.html
require 'octokit'

c = Octokit::Client.new(access_token: ENV['DANGER_GITHUB_API_TOKEN'], auto_paginate: true)
prs = c.pull_requests(ENV['SEMAPHORE_GIT_REPO_SLUG'], state: 'open')
current_pr = prs.select { |pr| pr[:head][:ref] == ENV['SEMAPHORE_GIT_BRANCH'] }

pr_value = current_pr.first[:number].to_s unless current_pr.nil?

puts pr_value
            - export SEMAPHORE_REPO_SLUG=$SEMAPHORE_GIT_REPO_SLUG
            - export PULL_REQUEST_NUMBER=$(ruby bin/pull_request_number.rb)
            - bundle exec danger
Read more comments on GitHub >

github_iconTop Results From Across the Web

sem_wait()-Wait for Semaphore - IBM
The sem_wait() function decrements by one the value of the semaphore. The semaphore will be decremented when its value is greater than zero....
Read more >
Terms of Service - Semaphore CI
Semaphore will not intentionally disclose, distribute, transmit or use any Customer Data except (a) as reasonably necessary for Semaphore (or ...
Read more >
Semaphores and Semaphore Timeouts - HCL support
If a user task now tries to open that index while it is being rebuilt, it will have to wait for the indexer...
Read more >
Semaphore (programming) - Wikipedia
In computer science, a semaphore is a variable or abstract data type used to control access ... Some other mechanism (possibly involving more...
Read more >
Semaphores don't have owners - The Old New Thing
(This increase might release waiting threads.) But the thread releasing the semaphore need not be the same one that claimed it originally.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found