chipsalliance / verible-linter-action

Automatic SystemVerilog linting in github actions with the help of Verible
Apache License 2.0
24 stars 11 forks source link

Fix remote url handling when a PR from a fork is created #8

Closed wsipak closed 3 years ago

wsipak commented 3 years ago

The action needs to handle two remotes. One for the main repo, and the other for the source of the PR. This wasn't handled properly and is fixed here. The problem appeared here: https://github.com/lowRISC/ibex/pull/1434

Right now the script retrieves the URL of the remote from event.json and fetches the right branch from it. Additionally, hash of the HEAD is printed so that it's easy to confirm correctness of operation.

I've checked these scenarios:

  1. The branch used in a PR doesn't exist in the main repo, and it works.
  2. The branch used in a PR does exist in the main repo, and it's actually fetched from the fork. (Previously the script tried to fetch it from mainline)