From f9721149ab607c56147632100294f034035ad9ca Mon Sep 17 00:00:00 2001 From: CrowleyRajapakse Date: Fri, 16 Feb 2024 09:22:34 +0530 Subject: [PATCH] adding delete workflow trigger action --- .github/workflows/delete-workflow-trigger.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/delete-workflow-trigger.yml diff --git a/.github/workflows/delete-workflow-trigger.yml b/.github/workflows/delete-workflow-trigger.yml new file mode 100644 index 00000000..ae4073fb --- /dev/null +++ b/.github/workflows/delete-workflow-trigger.yml @@ -0,0 +1,26 @@ +name: Remove github integration action trigger label +on: + pull_request_target: + types: + - synchronize + - closed +concurrency: + group: apim-apk-agent-${{ github.event.number || github.run_id }} + cancel-in-progress: true +jobs: + remove-label: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Remove label + run: | + TOKEN="${{ secrets.GITHUB_TOKEN }}" + PR_NUMBER="${{ github.event.number }}" + LABEL_TO_REMOVE="trigger-action" + + # Remove the label from the pull request + curl -X DELETE \ + -H "Authorization: token $TOKEN" \ + "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/${LABEL_TO_REMOVE}" \ No newline at end of file