Skip to content

Commit 8d1c039

Browse files
authored
Merge branch 'main' into patch-1
2 parents c2fb830 + cdbb559 commit 8d1c039

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.github/scripts/docathon-label-sync.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ def main():
2525
issue_number = int(re.findall(r'#(\d{1,5})', pull_request_body)[0])
2626
issue = repo.get_issue(issue_number)
2727
issue_labels = issue.labels
28-
docathon_label_present = any(label.name == 'docathon-h2-2023' for label in issue_labels)
28+
docathon_label_present = any(label.name == 'docathon-h1-2024' for label in issue_labels)
2929

3030
# if the issue has a docathon label, add all labels from the issue to the PR.
3131
if not docathon_label_present:
32-
print("The 'docathon-h2-2023' label is not present in the issue.")
32+
print("The 'docathon-h1-2024' label is not present in the issue.")
3333
return
3434
pull_request_labels = pull_request.get_labels()
3535
issue_label_names = [label.name for label in issue_labels]
3636
labels_to_add = [label for label in issue_label_names if label not in pull_request_labels]
3737
if not labels_to_add:
3838
print("The pull request already has the same labels.")
3939
return
40-
pull_request.set_labels(*labels_to_add)
40+
pull_request.add_to_labels(*labels_to_add)
4141
print("Labels added to the pull request!")
4242

4343

.github/workflows/docathon-label-sync.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
jobs:
88
check-labels:
99
runs-on: ubuntu-latest
10-
10+
permissions:
11+
issues: write
12+
pull-requests: write
1113
steps:
1214
- name: Check if PR mentions an issue and get labels
1315
uses: actions/checkout@v2
1416
with:
15-
fetch-depth: 0
17+
fetch-depth: 1
1618
- name: Set up Python
1719
uses: actions/setup-python@v2
1820
with:

0 commit comments

Comments
 (0)