From 41e247d27811a1f8739efd5c835634accb7faa99 Mon Sep 17 00:00:00 2001 From: GabinL21 Date: Tue, 29 Oct 2024 16:15:02 +0100 Subject: [PATCH 1/2] Prevent bots from creating tickets --- .github/workflows/PullRequestCreated.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/PullRequestCreated.yml b/.github/workflows/PullRequestCreated.yml index f0b1cc652..f9b0ef888 100644 --- a/.github/workflows/PullRequestCreated.yml +++ b/.github/workflows/PullRequestCreated.yml @@ -2,7 +2,7 @@ name: Pull Request Created on: pull_request: - types: ["opened"] + types: [ "opened" ] jobs: PullRequestCreated_job: @@ -12,7 +12,8 @@ jobs: id-token: write # For external PR, ticket should be created manually if: | - github.event.pull_request.head.repo.full_name == github.repository + github.event.pull_request.head.repo.full_name == github.repository + && github.event.sender.type != 'Bot' steps: - id: secrets uses: SonarSource/vault-action-wrapper@v3 @@ -24,6 +25,6 @@ jobs: - uses: sonarsource/gh-action-lt-backlog/PullRequestCreated@v2 with: github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }} - jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }} - jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }} + jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }} + jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }} jira-project: SONARPHP From 59d52efe903a6976f2b8af7a71c46d6958fb1a18 Mon Sep 17 00:00:00 2001 From: GabinL21 <67428953+GabinL21@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:19:07 +0100 Subject: [PATCH 2/2] Fix formatting --- .github/workflows/PullRequestCreated.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/PullRequestCreated.yml b/.github/workflows/PullRequestCreated.yml index f9b0ef888..339b7932f 100644 --- a/.github/workflows/PullRequestCreated.yml +++ b/.github/workflows/PullRequestCreated.yml @@ -2,7 +2,7 @@ name: Pull Request Created on: pull_request: - types: [ "opened" ] + types: ["opened"] jobs: PullRequestCreated_job: @@ -12,8 +12,8 @@ jobs: id-token: write # For external PR, ticket should be created manually if: | - github.event.pull_request.head.repo.full_name == github.repository - && github.event.sender.type != 'Bot' + github.event.pull_request.head.repo.full_name == github.repository + && github.event.sender.type != 'Bot' steps: - id: secrets uses: SonarSource/vault-action-wrapper@v3 @@ -25,6 +25,6 @@ jobs: - uses: sonarsource/gh-action-lt-backlog/PullRequestCreated@v2 with: github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }} - jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }} - jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }} + jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }} + jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }} jira-project: SONARPHP