Skip to content

Commit

Permalink
Update Base SHA for Dangerfile checks (#20032)
Browse files Browse the repository at this point in the history
* puts refs

* update HEAD/BASE SHA

* add 'origin/' to branches

* remove unnecessary refs to head/base

* fix case of empty string
  • Loading branch information
ryan-mcneil authored Dec 31, 2024
1 parent f600f94 commit 9257976
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
bundler-cache: true

- name: Run Danger
run: bundle exec danger --head=${{ github.sha }} --base=${{ github.event.pull_request.base.sha }} --verbose
run: bundle exec danger --verbose

- name: Add Danger Label
uses: actions-ecosystem/action-remove-labels@v1
Expand Down
4 changes: 2 additions & 2 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require 'ostruct'

module VSPDanger
HEAD_SHA = `git rev-parse --abbrev-ref HEAD`.chomp.freeze
BASE_SHA = 'origin/master'
HEAD_SHA = ENV.fetch('GITHUB_HEAD_REF', '').empty? ? `git rev-parse --abbrev-ref HEAD`.chomp.freeze : "origin/#{ENV.fetch('GITHUB_HEAD_REF')}"
BASE_SHA = ENV.fetch('GITHUB_BASE_REF', '').empty? ? 'origin/master' : "origin/#{ENV.fetch('GITHUB_BASE_REF')}"

class Runner
def self.run
Expand Down

0 comments on commit 9257976

Please sign in to comment.