Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept PR number in thylint action #354

Merged
merged 2 commits into from
Jul 9, 2024
Merged

accept PR number in thylint action #354

merged 2 commits into from
Jul 9, 2024

Conversation

lsf37
Copy link
Member

@lsf37 lsf37 commented Jul 9, 2024

The thylint action produces a json file with annotations, and to display those annotations also for PRs from forks, we need the action to be triggered by pull_request_target. For security pull_request_target provides a different GITHUB_REF (not to the head of the pull request as usual), so we will need to explicitly provide the PR target that needs to be checked out. To do this:

  • extended scripts/checkout.sh to accept INPUT_PR_NUM and check out whatever that points to
  • add pr_num arguments to the thylint action (which GitHub then turns in INPUT_PR_NUM)

@lsf37 lsf37 requested a review from corlewis July 9, 2024 06:07
@lsf37 lsf37 self-assigned this Jul 9, 2024
lsf37 added 2 commits July 9, 2024 16:10
If an PR explicit PR number is passed, check out that PR, otherwise
check out GITHUB_REF. This enables pull_request_target actions to
provide an explicit target.

Signed-off-by: Gerwin Klein <[email protected]>
GitHub turns this into INPUT_PR_NUM, which is consumed by
`scripts/checkout.sh`.

Signed-off-by: Gerwin Klein <[email protected]>
@lsf37 lsf37 merged commit c705c08 into master Jul 9, 2024
7 checks passed
@lsf37 lsf37 deleted the linter-pr-target branch July 9, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants