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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions scripts/checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ else
REPO_URL="https://${REPO_PATH}"
fi

echo "Cloning ${REPO_PATH}@${GITHUB_REF}"
# if an explicit PR number is set as INPUT (e.g. for pull_request_target), prefer that
if [ -n "${INPUT_PR_NUM}" ]
then
REF="refs/pull/${INPUT_PR_NUM}/head"
else
REF="${GITHUB_REF}"
fi

echo "Cloning ${REPO_PATH}@${REF}"
git init -q .
git remote add origin ${REPO_URL}
git fetch -q --no-tags --depth ${DEPTH} origin +${GITHUB_REF}:refs/heads/test-revision
git fetch -q --no-tags --depth ${DEPTH} origin +${REF}:refs/heads/test-revision
git checkout -q test-revision
1 change: 1 addition & 0 deletions thylint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ that can be displayed as source annotation with the [yuzutech/annotations][1] ac
- `disable`: a comma-separated list of warning classes to disable (default: none).
One of `diag`, `find-proofs`, `sorry`, `axiom`, `style`.
Do not use spaces between comma and warning class.
- `pr_num`: pull request number to check out, e.g. for `pull_request_target` triggers.
- `token`: GitHub PA token to authenticate for private repos (optional)

## Example
Expand Down
3 changes: 3 additions & 0 deletions thylint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
token:
description: 'GitHub token for read access to repository'
required: false
pr_num:
description: 'Explicit pull request number to check out, e.g. for pull_request_target'
required: false
disable:
description: 'Comma-separated list (no spaces) of warning classes to disable (default: none)'
required: false
Expand Down