From 9198633453f6e941b16d01908141c66e83286bac Mon Sep 17 00:00:00 2001 From: Billy Tat Date: Tue, 25 Feb 2025 16:46:20 -0800 Subject: [PATCH] Sanitize title using intermediate var in workflow Adjust title depending on Product or Community repo --- .github/workflows/create-issue.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-issue.yml b/.github/workflows/create-issue.yml index 8782be3c627..e4a6b1aa19b 100644 --- a/.github/workflows/create-issue.yml +++ b/.github/workflows/create-issue.yml @@ -21,9 +21,11 @@ jobs: - name: Create issue env: GH_TOKEN: ${{ github.token }} + REPO_TYPE: ${{ contains( github.repository, 'product-docs') && 'Product' || 'Community' }} + PR_TITLE: ${{ github.event.pull_request.title }} run: | gh issue create \ - --repo rancher/rancher-docs \ - --title 'Port Community docs PR #${{github.event.pull_request.number}}: ${{github.event.pull_request.title}}' \ - --body 'Reference: https://github.com/${{github.repository}}/pull/${{github.event.pull_request.number}}' \ - --label port/community-product \ No newline at end of file + --repo ${{ github.repository }} \ + --title "Port $REPO_TYPE docs PR #${{ github.event.pull_request.number }}: $PR_TITLE" \ + --body "Reference: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" \ + --label port/community-product \ No newline at end of file