Skip to content

Commit c5a083f

Browse files
committed
build: limit search to stdlib repository and exit early if not good first PR
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: passed - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 8fe91fb commit c5a083f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/scripts/rate_limit_contributions

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,17 @@ main() {
123123
pr_details=$(github_api "GET" "/repos/${repo_owner}/${repo_name}/pulls/${pr_number}")
124124
good_first_pr=$(echo "${pr_details}" | jq -r '.labels | any(.name == "Good First PR")')
125125

126+
# Check if the PR is labeled "Good First PR":
127+
if [ "${good_first_pr}" != "true" ]; then
128+
echo "PR is not labeled 'Good First PR'."
129+
print_success
130+
exit 0
131+
fi
132+
126133
pr_author=$(echo "${pr_details}" | jq -r '.user.login')
127134

128135
# Fetch other PRs of the same user:
129-
user_prs=$(github_api "GET" "/search/issues?q=state%3Aopen+author%3A${pr_author}+type%3Apr")
136+
user_prs=$(github_api "GET" "/search/issues?q=repo%3A${repo_owner}%2F${repo_name}+state%3Aopen+author%3A${pr_author}+type%3Apr")
130137

131138
# Count number of PRs labeled "Good First PR":
132139
num_good_first_prs=$(echo "${user_prs}" | jq -r '.items | map( select( .labels | any( .name == "Good First PR" ))) | length')

0 commit comments

Comments
 (0)