mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Update GH action to use the correct label (#154126)
Update GH action to use the correct label for the docathon Pull Request resolved: https://github.com/pytorch/pytorch/pull/154126 Approved by: https://github.com/AlannaBurke, https://github.com/clee2000
This commit is contained in:
committed by
PyTorch MergeBot
parent
31f3ee0966
commit
3c0cbf4b44
4
.github/scripts/docathon-label-sync.py
vendored
4
.github/scripts/docathon-label-sync.py
vendored
@ -28,12 +28,12 @@ def main() -> None:
|
||||
issue = repo.get_issue(issue_number)
|
||||
issue_labels = issue.labels
|
||||
docathon_label_present = any(
|
||||
label.name == "docathon-h1-2024" for label in issue_labels
|
||||
label.name == "docathon-h1-2025" for label in issue_labels
|
||||
)
|
||||
|
||||
# if the issue has a docathon label, add all labels from the issue to the PR.
|
||||
if not docathon_label_present:
|
||||
print("The 'docathon-h1-2024' label is not present in the issue.")
|
||||
print("The 'docathon-h1-2025' label is not present in the issue.")
|
||||
return
|
||||
pull_request_labels = pull_request.get_labels()
|
||||
pull_request_label_names = [label.name for label in pull_request_labels]
|
||||
|
6
.github/workflows/assigntome-docathon.yml
vendored
6
.github/workflows/assigntome-docathon.yml
vendored
@ -28,14 +28,14 @@ jobs:
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber
|
||||
});
|
||||
const hasLabel = issue.labels.some(label => label.name === 'docathon-h1-2024');
|
||||
const hasLabel = issue.labels.some(label => label.name === 'docathon-h1-2025');
|
||||
if (hasLabel) {
|
||||
if (issue.assignee !== null) {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
body: "The issue is already assigned. Please pick an opened and unnasigned issue with the [docathon-h1-2024 label](https://github.com/pytorch/pytorch/issues?q=is%3Aopen+is%3Aissue+label%3Adocathon-h1-2024)."
|
||||
body: "The issue is already assigned. Please pick an opened and unnasigned issue with the [docathon-h1-2025 label](https://github.com/pytorch/pytorch/issues?q=is%3Aopen+is%3Aissue+label%3Adocathon-h1-2025)."
|
||||
});
|
||||
} else {
|
||||
await github.rest.issues.addAssignees({
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const commmentMessage = "This issue does not have the correct label. Please pick an opened and unnasigned issue with the [docathon-h1-2024 label](https://github.com/pytorch/pytorch/issues?q=is%3Aopen+is%3Aissue+label%3Adocathon-h1-2024)."
|
||||
const commmentMessage = "This issue does not have the correct label. Please pick an opened and unnasigned issue with the [docathon-h1-2025 label](https://github.com/pytorch/pytorch/issues?q=is%3Aopen+is%3Aissue+label%3Adocathon-h1-2025)."
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
|
Reference in New Issue
Block a user