Skip to content

Commit 557ba96

Browse files
Planeshiftersaurabhraghuvanshii
authored andcommitted
build: only fetch PRs from same author
--- 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: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent d011952 commit 557ba96

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/labeler.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,23 +160,25 @@ jobs:
160160
}
161161
}
162162
163-
# Remove "First-time Contributor" label from other open PRs if PR is merged:
164-
- name: 'Remove "First-time Contributor" label from other open PRs if PR is merged'
163+
# Remove "First-time Contributor" label from other open PRs of same author if PR is merged:
164+
- name: 'Remove "First-time Contributor" label from other open PRs of same author if PR is merged'
165165
if: ${{ github.event.action == 'closed' && github.event.pull_request.merged == true }}
166166
# Pin action to full length commit SHA
167167
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
168168
with:
169169
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
170170
script: |
171171
const prAuthor = context.payload.pull_request.user.login;
172+
const { owner, repo } = context.repo;
172173
173-
const { data: pullRequests } = await github.rest.pulls.list({
174-
'owner': context.repo.owner,
175-
'repo': context.repo.repo,
176-
'state': 'open'
174+
// Search for all open PRs from the PR author:
175+
const query = `repo:${owner}/${repo} type:pr state:open author:${prAuthor}`;
176+
const response = await github.rest.search.issuesAndPullRequests({
177+
'q': query,
178+
'per_page': 100
177179
});
178180
179-
// Remove "First-time Contributor" label from any other open PRs by the same author:
181+
const pullRequests = response.data.items;
180182
for ( const pull of pullRequests ) {
181183
if ( pull.user.login === prAuthor ) {
182184
try {

0 commit comments

Comments
 (0)