Skip to content

Commit 5846344

Browse files
Update issue_team_pr.yaml
1 parent e503f9a commit 5846344

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

.github/workflows/issue_team_pr.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,39 @@ on:
55

66
jobs:
77
create_pr:
8-
# Double validation: Label + Title pattern
9-
if: |
10-
contains(github.event.issue.labels.*.name, 'team-request') &&
11-
startsWith(github.event.issue.title, '[Team]')
128
runs-on: ubuntu-latest
9+
# Debug why conditions might fail
10+
env:
11+
ISSUE_TITLE: ${{ github.event.issue.title }}
12+
ISSUE_LABELS: ${{ toJSON(github.event.issue.labels) }}
13+
1314
steps:
14-
- name: Verify Team Request
15-
id: verify
15+
- name: Debug Inputs
1616
run: |
17-
if [[ ! "${{ github.event.issue.body }}" =~ '- Team Name: TEAM-' ]]; then
18-
echo "::error::Not a valid team request issue"
19-
exit 1
17+
echo "Title: $ISSUE_TITLE"
18+
echo "Labels: $ISSUE_LABELS"
19+
echo "Body: ${{ github.event.issue.body }}"
20+
21+
# Simplified condition with explicit checks
22+
- name: Check if Team Request
23+
id: check_team
24+
run: |
25+
if [[ "$ISSUE_TITLE" =~ ^\[Team\] ]] &&
26+
[[ "$ISSUE_LABELS" == *'"name":"team-request"'* ]] &&
27+
[[ "${{ github.event.issue.body }}" == *'- Team Name: TEAM-'* ]]; then
28+
echo "is_team_request=true" >> $GITHUB_OUTPUT
29+
else
30+
echo "is_team_request=false" >> $GITHUB_OUTPUT
31+
echo "::warning::Not a valid team request"
2032
fi
2133
2234
- name: Create PR
35+
if: steps.check_team.outputs.is_team_request == 'true'
2336
uses: peter-evans/create-pull-request@v5
2437
with:
2538
title: "Team Request: ${{ github.event.issue.title }}"
2639
body: |
27-
**Automated from #${{ github.event.issue.number }}**
40+
**From Issue #${{ github.event.issue.number }}**
2841
```yaml
2942
${{ github.event.issue.body }}
3043
```

0 commit comments

Comments
 (0)