From 8a2a71c099e9d0c7aed64dd61506be2cee0d35c3 Mon Sep 17 00:00:00 2001 From: Flurb Date: Sun, 16 Jan 2022 23:52:45 +0100 Subject: [PATCH] Added Dependabot PR fix Signed-off-by: Flurb --- .github/workflows/automate-projects.yml | 8 +++++--- .github/workflows/sonarcloud-analysis.yml | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/automate-projects.yml b/.github/workflows/automate-projects.yml index 770803d..8c8449c 100644 --- a/.github/workflows/automate-projects.yml +++ b/.github/workflows/automate-projects.yml @@ -4,11 +4,13 @@ name: Add issues and pull request to project boards -on: [ issues, pull_request ] +on: [ issues, pull_request, pull_request_target ] jobs: github-actions-automate-projects: runs-on: ubuntu-latest + + if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} steps: - name: add-new-issues-to-repository-based-project-column uses: docker://takanabe/github-actions-automate-projects:v0.0.1 @@ -19,7 +21,7 @@ jobs: GITHUB_PROJECT_COLUMN_NAME: To do - name: add-new-pull-request-to-repository-based-project-column uses: docker://takanabe/github-actions-automate-projects:v0.0.1 - if: github.event_name == 'pull_request' && github.event.action == 'opened' + if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PROJECT_URL: https://github.com/com-pas/compas-core/projects/2 @@ -33,7 +35,7 @@ jobs: GITHUB_PROJECT_COLUMN_NAME: To do - name: add-new-pull-request-to-organization-based-project-column uses: docker://takanabe/github-actions-automate-projects:v0.0.1 - if: github.event_name == 'pull_request' && github.event.action == 'opened' + if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' env: GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2 diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index c01f762..134ba7b 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -12,11 +12,18 @@ on: branches: - 'main' - 'develop' + pull_request_target: + branches: + - 'main' + - 'develop' jobs: build: name: Build runs-on: ubuntu-latest + timeout-minutes: 15 + + if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} steps: - uses: actions/checkout@v2 with: @@ -52,4 +59,5 @@ jobs: -Dsonar.projectKey=com-pas_compas-core \ -Dsonar.organization=com-pas \ -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar