From 2dc6e5075f449399cc0a1d6360d0c94ca7fef0f9 Mon Sep 17 00:00:00 2001 From: Niall Byrne <9848926+niall-byrne@users.noreply.github.com> Date: Mon, 13 Mar 2023 13:14:28 -0400 Subject: [PATCH] ci(GITHUB): test remote workflow --- .github/workflows/.job-00-start.yml | 36 -------------------- .github/workflows/.job-00-success.yml | 36 -------------------- .github/workflows/workflow-template-test.yml | 16 ++++++--- 3 files changed, 11 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/.job-00-start.yml delete mode 100644 .github/workflows/.job-00-success.yml diff --git a/.github/workflows/.job-00-start.yml b/.github/workflows/.job-00-start.yml deleted file mode 100644 index afb37f43..00000000 --- a/.github/workflows/.job-00-start.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: ansible-workbench-job-start-notification - -on: - workflow_call: - secrets: - SLACK_WEBHOOK: - description: "Optional, enables Slack notifications." - required: false - -jobs: - - start_notification: - - runs-on: ubuntu-latest - - steps: - - name: Start -- Checkout Repository - uses: actions/checkout@v3 - with: - path: 'template' - - - name: Start -- Setup Environment - run: | - source "./template/.github/scripts/workflow-setup-environment.sh" - env: - WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - - name: Start -- Report Job Status on Success - run: | - "./template/{{cookiecutter.project_slug}}/.github/scripts/task-slack-notification.sh" "${NOTIFICATION}" ":white_check_mark: workflow has started!" - - - name: Start -- Report Job Status on Failure - if: failure() - run: | - "./template/{{cookiecutter.project_slug}}/.github/scripts/task-slack-notification.sh" "${NOTIFICATION}" ":x: error reporting job status!" diff --git a/.github/workflows/.job-00-success.yml b/.github/workflows/.job-00-success.yml deleted file mode 100644 index acc5136e..00000000 --- a/.github/workflows/.job-00-success.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: ansible-workbench-job-start-notification - -on: - workflow_call: - secrets: - SLACK_WEBHOOK: - description: "Optional, enables Slack notifications." - required: false - -jobs: - - start_notification: - - runs-on: ubuntu-latest - - steps: - - name: Success -- Checkout Repository - uses: actions/checkout@v3 - with: - path: 'template' - - - name: Success -- Setup Environment - run: | - source "./template/.github/scripts/workflow-setup-environment.sh" - env: - WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - - name: Success -- Report Job Status on Success - run: | - "./template/{{cookiecutter.project_slug}}/.github/scripts/task-slack-notification.sh" "${NOTIFICATION}" ":white_check_mark: all checks were successful!" - - - name: Success -- Report Job Status on Failure - if: failure() - run: | - "./template/{{cookiecutter.project_slug}}/.github/scripts/task-slack-notification.sh" "${NOTIFICATION}" ":x: error reporting job status!" diff --git a/.github/workflows/workflow-template-test.yml b/.github/workflows/workflow-template-test.yml index 47c5b2d4..1f804c56 100644 --- a/.github/workflows/workflow-template-test.yml +++ b/.github/workflows/workflow-template-test.yml @@ -36,20 +36,26 @@ jobs: source "./{{cookiecutter.project_slug}}/.github/scripts/workflow-set-value.sh" cat "cookiecutter.json" start: - uses: ./.github/workflows/.job-00-start.yml secrets: inherit + uses: niall-byrne/cicd-tools/.github/workflows/.job-00-notification.yml@master + with: + NOTIFICATION_EMOJI: ":white_check_mark:" + NOTIFICATION_MESSAGE: "workflow has started!" success: - needs: [create_release] - uses: ./.github/workflows/.job-00-success.yml + needs: [start] secrets: inherit + uses: niall-byrne/cicd-tools/.github/workflows/.job-00-notification.yml@master + with: + NOTIFICATION_EMOJI: ":checkered_flag:" + NOTIFICATION_MESSAGE: "workflow has completed successfully!" security_test: needs: [configuration] - uses: ./.github/workflows/.job-10-security.yml + secrets: inherit + uses: niall-byrne/cicd-tools/.github/workflows/.job-10-security.yml@master with: CONFIGURATION: ${{ needs.configuration.outputs.configuration }} - secrets: inherit documentation_test: needs: [configuration]