Skip to content

Commit

Permalink
get repo name dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy B committed May 11, 2020
1 parent d0b4fd0 commit f973d99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ On a failed check the action will exit with 1 and stop the workflow. On success

- A push to master triggers a `test` workflow that runs tests on application code.
- A push to master triggers a webhook that builds an image on external service (Quay, DockerHub, etc.)
- Once the image is built, a `repository_dispatch` hook is truggered from a third-party service that launches a `deploy` workflow.
- Once the image is built, a `repository_dispatch` hook is triggered from a third-party service that launches a `deploy` workflow.
- We don't want the `deploy` workflow to succeed until we're sure that the `master` branch is green in `test` workflow.
- We add the "Wait on tests" step to make sure `deploy` does not succeed before `test` for a master branch.

Expand Down
4 changes: 3 additions & 1 deletion entrypoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
require "uri"
require "json"

REPO = ENV["GITHUB_REPOSITORY"]

def query_check_status(ref, check_name, token)
uri = URI.parse("https://api.github.com/repos/lewagon/linkedin/commits/#{ref}/check-runs?check_name=#{check_name}")
uri = URI.parse("https://api.github.com/repos/#{REPO}/commits/#{ref}/check-runs?check_name=#{check_name}")
request = Net::HTTP::Get.new(uri)
request["Accept"] = "application/vnd.github.antiope-preview+json"
request["Authorization"] = "token #{token}"
Expand Down

0 comments on commit f973d99

Please sign in to comment.