Skip to content

Commit f66701b

Browse files
authored
fix assigner more (#462)
* try again * test draft * more cleanup * delete test readme * one more simplification
1 parent 5240dfa commit f66701b

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/scripts/assign_xls_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def find_draft_xls_files(changed_files: list[str]) -> list[str]:
6363
Returns:
6464
List of draft XLS directory names (e.g., ["XLS-draft-my-feature"])
6565
"""
66-
draft_pattern = re.compile(r"^(XLS-draft-[^/]+)/README\.md$")
66+
draft_pattern = re.compile(r"^((XLS|xls)-draft[^/]+)/README\.md$")
6767
drafts = []
6868

6969
for file_path in changed_files:

.github/workflows/assign-xls-number.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,41 @@
11
name: Assign XLS Number
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
4+
pull_request_target:
5+
types: [opened, synchronize, reopened, ready_for_review]
66

77
jobs:
88
assign-xls-number:
99
runs-on: ubuntu-latest
1010
name: Assign XLS Number to Draft
1111
permissions:
1212
pull-requests: write
13+
issues: write
1314
contents: read
1415

1516
steps:
1617
- name: Checkout repository
1718
uses: actions/checkout@v6
1819
with:
1920
fetch-depth: 0
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
23+
- name: Checkout script from base branch
24+
uses: actions/checkout@v6
25+
with:
26+
ref: ${{ github.event.pull_request.base.ref }}
27+
sparse-checkout: |
28+
.github/scripts/assign_xls_number.py
29+
sparse-checkout-cone-mode: false
30+
path: base-repo
2031

2132
- name: Get added files
2233
id: added-files
2334
uses: tj-actions/changed-files@v47
2435
with:
2536
files: |
26-
XLS-draft-*/README.md
27-
xls-draft-*/README.md
37+
XLS-draft*/README.md
38+
xls-draft*/README.md
2839
# Only look at added files, not modified ones
2940
include_all_old_new_renamed_files: false
3041

@@ -53,7 +64,7 @@ jobs:
5364
id: assign-number
5465
run: |
5566
echo ${{ steps.check-drafts.outputs.draft_files }}
56-
python .github/scripts/assign_xls_number.py ${{ steps.check-drafts.outputs.draft_files }}
67+
python base-repo/.github/scripts/assign_xls_number.py ${{ steps.check-drafts.outputs.draft_files }}
5768
5869
- name: Check for existing assignment comment
5970
if: steps.check-drafts.outputs.has_drafts == 'true'

0 commit comments

Comments
 (0)