From 0d1dc431e4668e5a103fe70054f3c29f89d96f85 Mon Sep 17 00:00:00 2001 From: mchuangatmp <85254535+mchuangatmp@users.noreply.github.com> Date: Wed, 27 Oct 2021 15:09:41 -0700 Subject: [PATCH] fix: update reusable workflow urls --- .github/workflows/pr-branch-check.yml | 42 -------------------- .github/workflows/pr-branch-confirmation.yml | 33 --------------- .github/workflows/pr-title-check.yml | 41 ------------------- .github/workflows/reusable-workflows.yml | 15 +++++++ 4 files changed, 15 insertions(+), 116 deletions(-) delete mode 100644 .github/workflows/pr-branch-check.yml delete mode 100644 .github/workflows/pr-branch-confirmation.yml delete mode 100644 .github/workflows/pr-title-check.yml create mode 100644 .github/workflows/reusable-workflows.yml diff --git a/.github/workflows/pr-branch-check.yml b/.github/workflows/pr-branch-check.yml deleted file mode 100644 index ab3a9009..00000000 --- a/.github/workflows/pr-branch-check.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Branch Name PR Check -on: - workflow_call: - pull_request: - types: [opened, synchronize, edited] -jobs: - pr-branch-name-check: - name: Check PR for semantic branch name - if: ${{ github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-18.04 - steps: - - name: Set PR branch validity - id: is-semantic - if: > - startsWith(github.event.pull_request.head.ref, 'feat/')|| - startsWith(github.event.pull_request.head.ref, 'fix/') || - startsWith(github.event.pull_request.head.ref, 'perf/') || - startsWith(github.event.pull_request.head.ref, 'docs/') || - startsWith(github.event.pull_request.head.ref, 'test/') || - startsWith(github.event.pull_request.head.ref, 'refactor/') || - startsWith(github.event.pull_request.head.ref, 'style/') || - startsWith(github.event.pull_request.head.ref, 'build/') || - startsWith(github.event.pull_request.head.ref, 'ci/') || - startsWith(github.event.pull_request.head.ref, 'chore/') || - startsWith(github.event.pull_request.head.ref, 'revert/') - run: | - OUTPUT=true - echo "::set-output name=isSemantic::$OUTPUT" - - name: echo isSemantic - run: | - echo ${{ steps.is-semantic.outputs.isSemantic }} - - name: Branch name is valid - if: ${{steps.is-semantic.outputs.isSemantic == 'true'}} - run: | - echo 'Pull request branch name is valid.' - echo ${{ steps.is-semantic.outputs.isSemantic }} - - name: Branch name is invalid - if: ${{ steps.is-semantic.outputs.isSemantic != 'true'}} - run: | - echo ${{ steps.is-semantic.outputs.isSemantic }} - echo 'Pull request branch name is not valid.' - exit 1 diff --git a/.github/workflows/pr-branch-confirmation.yml b/.github/workflows/pr-branch-confirmation.yml deleted file mode 100644 index 22ba7d6c..00000000 --- a/.github/workflows/pr-branch-confirmation.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Target Branch PR Check -on: - workflow_call: - pull_request: - types: [opened, synchronize, edited] -jobs: - pr-branch-confirmation: - name: Confirm that target branch for PR is development or build/ - if: ${{ github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-18.04 - steps: - - name: Set PR title validity - id: is-valid - if: > - startsWith(github.event.pull_request.base.ref, 'development')|| - startsWith(github.event.pull_request.base.ref, 'build/') - run: | - OUTPUT=true - echo "::set-output name=isValid::$OUTPUT" - - name: echo isValid - run: | - echo ${{ steps.is-valid.outputs.isValid }} - - name: PR title is valid - if: ${{steps.is-valid.outputs.isValid == 'true'}} - run: | - echo 'Pull request target branch is valid.' - echo ${{ steps.is-valid.outputs.isValid }} - - name: PR title is invalid - if: ${{ steps.is-valid.outputs.isValid != 'true'}} - run: | - echo ${{ steps.is-valid.outputs.isValid }} - echo 'Pull request target branch is not valid.' - exit 1 diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml deleted file mode 100644 index 8366675c..00000000 --- a/.github/workflows/pr-title-check.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Semantic PR Check -on: - pull_request: - types: [opened, synchronize, edited] -jobs: - pr-title-check: - name: Check PR for semantic title - if: ${{ github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-18.04 - steps: - - name: Set PR title validity - id: is-semantic - if: > - startsWith(github.event.pull_request.title, 'feat:')|| - startsWith(github.event.pull_request.title, 'fix:') || - startsWith(github.event.pull_request.title, 'perf:') || - startsWith(github.event.pull_request.title, 'docs:') || - startsWith(github.event.pull_request.title, 'test:') || - startsWith(github.event.pull_request.title, 'refactor:') || - startsWith(github.event.pull_request.title, 'style:') || - startsWith(github.event.pull_request.title, 'build:') || - startsWith(github.event.pull_request.title, 'ci:') || - startsWith(github.event.pull_request.title, 'chore:') || - startsWith(github.event.pull_request.title, 'revert:') - run: | - OUTPUT=true - echo "::set-output name=isSemantic::$OUTPUT" - - name: echo isSemantic - run: | - echo ${{ steps.is-semantic.outputs.isSemantic }} - - name: PR title is valid - if: ${{steps.is-semantic.outputs.isSemantic == 'true'}} - run: | - echo 'Pull request title is valid.' - echo ${{ steps.is-semantic.outputs.isSemantic }} - - name: PR title is invalid - if: ${{ steps.is-semantic.outputs.isSemantic != 'true'}} - run: | - echo ${{ steps.is-semantic.outputs.isSemantic }} - echo 'Pull request title is not valid.' - exit 1 diff --git a/.github/workflows/reusable-workflows.yml b/.github/workflows/reusable-workflows.yml new file mode 100644 index 00000000..d1adfd09 --- /dev/null +++ b/.github/workflows/reusable-workflows.yml @@ -0,0 +1,15 @@ +name: "Reusable Workflows" + +on: + pull_request: + +jobs: + pr-branch-check-name: + name: "Check PR for semantic branch name" + uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-check-name.yml@stable + pr-title-check: + name: "Check PR for semantic title" + uses: mParticle/mparticle-workflows/.github/workflows/pr-title-check.yml@stable + pr-branch-target-gitflow: + name: "Check PR for semantic target branch" + uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-target-gitflow.yml@stable