|
5 | 5 |
|
6 | 6 | jobs: |
7 | 7 | 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]') |
12 | 8 | 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 | + |
13 | 14 | steps: |
14 | | - - name: Verify Team Request |
15 | | - id: verify |
| 15 | + - name: Debug Inputs |
16 | 16 | 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" |
20 | 32 | fi |
21 | 33 |
|
22 | 34 | - name: Create PR |
| 35 | + if: steps.check_team.outputs.is_team_request == 'true' |
23 | 36 | uses: peter-evans/create-pull-request@v5 |
24 | 37 | with: |
25 | 38 | title: "Team Request: ${{ github.event.issue.title }}" |
26 | 39 | body: | |
27 | | - **Automated from #${{ github.event.issue.number }}** |
| 40 | + **From Issue #${{ github.event.issue.number }}** |
28 | 41 | ```yaml |
29 | 42 | ${{ github.event.issue.body }} |
30 | 43 | ``` |
|
0 commit comments