Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/assign_xls_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def find_draft_xls_files(changed_files: list[str]) -> list[str]:
Returns:
List of draft XLS directory names (e.g., ["XLS-draft-my-feature"])
"""
draft_pattern = re.compile(r"^(XLS-draft-[^/]+)/README\.md$")
draft_pattern = re.compile(r"^((XLS|xls)-draft[^/]+)/README\.md$")
drafts = []

for file_path in changed_files:
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/assign-xls-number.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
name: Assign XLS Number

on:
pull_request:
types: [opened, synchronize, reopened]
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
assign-xls-number:
runs-on: ubuntu-latest
name: Assign XLS Number to Draft
permissions:
pull-requests: write
issues: write
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout script from base branch
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.base.ref }}
sparse-checkout: |
.github/scripts/assign_xls_number.py
sparse-checkout-cone-mode: false
path: base-repo

- name: Get added files
id: added-files
uses: tj-actions/changed-files@v47
with:
files: |
XLS-draft-*/README.md
xls-draft-*/README.md
XLS-draft*/README.md
xls-draft*/README.md
# Only look at added files, not modified ones
include_all_old_new_renamed_files: false

Expand Down Expand Up @@ -53,7 +64,7 @@ jobs:
id: assign-number
run: |
echo ${{ steps.check-drafts.outputs.draft_files }}
python .github/scripts/assign_xls_number.py ${{ steps.check-drafts.outputs.draft_files }}
python base-repo/.github/scripts/assign_xls_number.py ${{ steps.check-drafts.outputs.draft_files }}

- name: Check for existing assignment comment
if: steps.check-drafts.outputs.has_drafts == 'true'
Expand Down