-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0748f8d
commit 7a6e6f7
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
name: Daily Repository Check | ||
|
||
on: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
|
||
jobs: | ||
checking-repos: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
repo: ${{ fromJson(vars.SCHEDULED_REPOS) }} | ||
steps: | ||
- name: Running workflow | ||
id: running-workflow | ||
uses: singnet/das-cicd@master | ||
with: | ||
workflow: ${{ matrix.repo.workflow_id }} | ||
repo: ${{ matrix.repo.name }} | ||
org: singnet | ||
ref: master | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Send success notification | ||
if: steps.running-workflow.outputs.conclusion == 'success' | ||
uses: singnet/integration-github-mattermost@master | ||
with: | ||
webhook-url: ${{ secrets.SCHEDULED_REPOS_MATTERMOST_WEBHOOK_URL }} | ||
env: | ||
MATTERMOST_MESSAGE: "SUCCESS - CI workflow succeeded in repository ${{ matrix.repo.name }}" | ||
|
||
- name: Send failure notification | ||
if: steps.running-workflow.outputs.conclusion != 'success' | ||
uses: singnet/integration-github-mattermost@master | ||
with: | ||
webhook-url: ${{ secrets.SCHEDULED_REPOS_MATTERMOST_WEBHOOK_URL }} | ||
env: | ||
MATTERMOST_MESSAGE: |- | ||
FAILURE - CI workflow failed in repository ${{ matrix.repo.name }} | ||
Details: ${{ fromJson(steps.running-workflow.outputs.failed_job).url }} | ||
Failed job: ${{ fromJson(steps.running-workflow.outputs.failed_job).failed_at }} |