From 8f0b8aa7e14de7db203b964fb215de077fc0b05a Mon Sep 17 00:00:00 2001 From: Cat Chen Date: Mon, 22 Aug 2022 11:58:58 -0700 Subject: [PATCH] Separated Workflows to two Workflows when triggered by Dependabot (#94) --- .github/workflows/build.yml | 12 +++++++++++- .github/workflows/test.yml | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab32593e..d0cbe23c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,12 +5,16 @@ on: branches: [main] pull_request: branches: [main, "[0-9]+-[0-9]+-*"] + workflow_run: + workflows: ["Dependabot Build"] + types: + - completed workflow_dispatch: jobs: build: name: Build - if: ${{ !startsWith(github.head_ref, 'workflows/tests/') }} + if: ${{ !startsWith(github.head_ref, 'workflows/tests/') && github.actor != 'dependabot[bot]' }} runs-on: ubuntu-latest permissions: write-all steps: @@ -34,3 +38,9 @@ jobs: fail-if-not-clean: true push-if-not-clean: true github-token: ${{ secrets.CHECK_GIT_STATUS_ACTION_TOKEN }} + + dependabot-build: + name: Dependabot Build + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - run: exit 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73eee7b5..b57aa63d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,12 +3,16 @@ name: Test on: pull_request: branches: [main, "[0-9]+-[0-9]+-*"] + workflow_run: + workflows: ["Dependabot Test"] + types: + - completed workflow_dispatch: jobs: test: name: Test - if: ${{ !startsWith(github.head_ref, 'workflows/tests/') }} + if: ${{ !startsWith(github.head_ref, 'workflows/tests/') && github.actor != 'dependabot[bot]' }} runs-on: ubuntu-latest permissions: write-all @@ -150,3 +154,9 @@ jobs: TEST_BRANCH_NAME: ${{ format('workflows/tests/{0}-{1}-on-{2}', github.run_number, github.run_attempt, github.sha) }} run: | git push -d origin "$TEST_BRANCH_NAME" + + dependabot-build: + name: Dependabot Test + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - run: exit 0