From b68f9d7b91d411d42256be01c54fd440f071f6ca Mon Sep 17 00:00:00 2001 From: Shelby Holden Date: Tue, 25 Jul 2023 12:19:25 -0400 Subject: [PATCH] Use re-usable GHA workflows instead of dispatch update name --- .github/workflows/build-and-test.yml | 26 +++++--------------------- .github/workflows/publish.yml | 2 +- .github/workflows/tag.yml | 2 +- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 5341a0e4..25af404e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -68,7 +68,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - notify-slack: + notify-slack-on-failure: needs: [ build, unit-tests-and-sonarqube, source-clear ] runs-on: ubuntu-latest @@ -87,28 +87,12 @@ jobs: text: 'Build failed :sadpanda:' username: 'Java-PFB GitHub Action' - dispatch-tag: + tag: needs: [ build, unit-tests-and-sonarqube, source-clear ] - runs-on: ubuntu-latest - + uses: ./.github/workflows/tag.yml if: success() && github.ref == 'refs/heads/main' - steps: - - name: Fire off tag action - uses: broadinstitute/workflow-dispatch@v1 - with: - workflow: Tag - token: ${{ secrets.BROADBOT_TOKEN }} - publish-library: - needs: [ build, unit-tests-and-sonarqube, source-clear, dispatch-tag ] - runs-on: ubuntu-latest - + needs: [ build, unit-tests-and-sonarqube, source-clear, tag ] + uses: ./.github/workflows/publish.yml if: success() && github.ref == 'refs/heads/main' - - steps: - - name: Fire off Publish Library Action - uses: broadinstitute/workflow-dispatch@v1 - with: - workflow: Publish Library to Artifactory - token: ${{ secrets.BROADBOT_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea2ef69d..5a3f6f74 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,5 @@ name: Publish Library to Artifactory -on: create +on: workflow_call env: SERVICE_NAME: ${{ github.event.repository.name }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 6a8a4f33..b95e0b04 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -1,5 +1,5 @@ name: Tag -on: workflow_dispatch +on: workflow_call jobs: tag-job: