From 0040a29bdefd38977fe572fde78dc61a81b6d0a9 Mon Sep 17 00:00:00 2001 From: Shridhar TL Date: Fri, 3 Jan 2025 21:15:29 +0530 Subject: [PATCH] Added support to update resource only in action script --- .github/workflows/issue-responder.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/issue-responder.yml b/.github/workflows/issue-responder.yml index db7221b9..2a83f5ad 100644 --- a/.github/workflows/issue-responder.yml +++ b/.github/workflows/issue-responder.yml @@ -20,6 +20,11 @@ on: required: false type: boolean default: false + updateDocsOnly: + description: 'Do not add comments to the ticket' + required: false + type: boolean + default: false issues: types: [opened] issue_comment: @@ -83,6 +88,7 @@ jobs: COMMENT_USER="${{ github.actor }}" if grep -q "$COMMENT_USER" collaborators.txt; then echo "Comment was made by a collaborator." + echo "avoidComments=true" >> $GITHUB_ENV node github.mjs --ticket "$TICKET_NUMBER" \ --ticketType "$TICKET_TYPE" \ --repo "${{ github.repository }}" \ @@ -93,9 +99,20 @@ jobs: --updateOnly exit 0 fi + elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]] && [[ "${{ github.event.inputs.updateDocsOnly }}" == "true" ]]; then + echo "avoidComments=true" >> $GITHUB_ENV + node github.mjs --ticket "$TICKET_NUMBER" \ + --ticketType "$TICKET_TYPE" \ + --repo "${{ github.repository }}" \ + --orgId "${{ vars.RESPONDER_ORG_ID }}" \ + --botId "${{ vars.RESPONDER_BOT_ID }}" \ + --ghToken "${{ github.token }}" \ + --authToken "${{ secrets.RESPONDER_TOKEN }}" \ + --updateOnly fi - - name: Execute script + - name: Add comment to ticket + if: env.avoidComments != 'true' run: | node github.mjs --testMode "${{ github.event.inputs.avoidUpdate }}" --ticket "$TICKET_NUMBER" \ --ticketType "$TICKET_TYPE" \