golangci-lint-action icon indicating copy to clipboard operation
golangci-lint-action copied to clipboard

add support for pull_request_target and only-new-issues: true

Open kovetskiy opened this issue 2 years ago • 0 comments

The golangci-lint-action doesn't work when only-new-issues: true is specified, but the pull request was created from a private fork repository to a private repository.

See more why you would need pull_request_target for that: https://github.community/t/will-github-actions-support-pull-request-events-from-a-fork-to-a-private-base-repository/17471

The PR fixes this.

The action works perfectly with pull_request_target, but users should not forget to specify ref when running actions/checkout.

on: pull_request_target

[...]
      - uses: actions/checkout@v3
        with:
          [.. other with params ..]
          ref: "refs/pull/${{ github.event.number }}/head"
       [...]

      - name: golangci-lint
        uses: golangci/golangci-lint-action@NEW_VERSION
        with:
          only-new-issues: true
[...]

kovetskiy avatar Jun 22 '22 07:06 kovetskiy