Fix checkout in Pronto on external pull requests
Since the target branch was in a different repository, the action failed since it couldn't find the reference. The code here is based on a recent change in Pronto [1] and with a comparison between the repo.url property of pull_request.head and pull_request.base to determine if the pull request was created from a forked repository [1] https://github.com/prontolabs/pronto/commit/4fe28418b6
This commit is contained in:
6
.github/workflows/linters.yml
vendored
6
.github/workflows/linters.yml
vendored
@@ -13,6 +13,10 @@ jobs:
|
|||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
- name: Run Pronto
|
- name: Run pronto
|
||||||
run: |
|
run: |
|
||||||
|
if [ ${{ github.event.pull_request.head.repo.full_name }} == ${{ github.event.pull_request.base.repo.full_name }} ]; then
|
||||||
PRONTO_PULL_REQUEST_ID="$(jq --raw-output .number "$GITHUB_EVENT_PATH")" PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}" bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
|
PRONTO_PULL_REQUEST_ID="$(jq --raw-output .number "$GITHUB_EVENT_PATH")" PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}" bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
|
||||||
|
else
|
||||||
|
bundle exec pronto run --exit-code -c origin/${{ github.base_ref }}
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user