Skip to content

Commit

Permalink
workflow linting, failure workflow (#104)
Browse files Browse the repository at this point in the history
Co-authored-by: jamie zieziula <[email protected]>
  • Loading branch information
jamiezieziula and jamie zieziula authored Oct 2, 2024
1 parent 17ddbab commit 4fc68e8
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-image.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and push image
name: Build and Push Image

"on":
workflow_call:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/helm-unittest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# https://github.com/marketplace/actions/helm-unit-tests

name: Run Helm unit tests
name: Run Helm Unit Tests

"on":
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images-main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and push images for merges to main
name: Build and Push Images on Merge to Main

"on":
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images-prs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and push images for pull requests
name: Build and Push Images on Pull Requests

"on":
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images-tags.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and push images for tags
name: Build and Push Images on Tags

"on":
push:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Labeler

"on":
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/notify-on-failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Notify on Failure

"on":
workflow_run:
workflows:
- Build and Push Images on Tags
- Release Prefect Operator Helm Chart
- Updatecli Dependency Updates
types: [completed]

permissions: {}

jobs:
notify:
name: Notify on Failure
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
permissions:
# required to introspect the workflow run
actions: read
# required to read from the repo
contents: read
steps:
- name: Format date
run: |
formatted_date=$(date -d "${{ github.event.workflow_run.run_started_at }}" "+%b %d at %I:%M %p")
echo "FORMATTED_DATE=$formatted_date" >> $GITHUB_ENV
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: custom
# https://api.slack.com/reference/messaging/attachments
custom_payload: |
{
attachments: [{
pretext: ':x: Workflow triggered by ${{ github.actor }} failed',
title: '${{ github.event.workflow_run.display_title }} #${{github.event.workflow_run.run_number}}',
title_link: '${{ github.event.workflow_run.html_url }}',
footer: '${{ github.repository }} | ${{ env.FORMATTED_DATE }} UTC',
footer_icon: 'https://slack-imgs.com/?c=1&o1=wi32.he32.si&url=https%3A%2F%2Fslack.github.com%2Fstatic%2Fimg%2Ffavicon-neutral.png',
color: 'danger',
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_GHA_JOB_STATUS }}
1 change: 1 addition & 0 deletions .github/workflows/operator-lint-and-test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Lint and Test Prefect Operator Chart

"on":
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/update-helm-versions.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Updatecli Dependency Updates

"on":
schedule:
- cron: 0 15 * * 1 # Monday @ 3pm UTC
workflow_dispatch: {}

permissions: {}

jobs:
updatecli_minor:
runs-on: ubuntu-latest
permissions:
# required to write to the repo
contents: write
# required to open a pr with updatecli changes
pull-requests: write
steps:
- name: checkout
uses: actions/checkout@v4

- name: updatecli-minor-apply
uses: prefecthq/actions-updatecli-apply@main
with:
manifest-path: .github/updatecli/manifest.yaml
run-type: minor
11 changes: 4 additions & 7 deletions .github/workflows/validate-updatecli-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Validate updatecli config
name: Validate Updatecli Config

"on":
pull_request:
Expand All @@ -8,23 +8,20 @@ name: Validate updatecli config
paths:
- .github/updatecli/**

# Do not grant jobs any permissions by default
permissions: {}

jobs:
validate_updatecli_config:
validate_updatecli_configs:
runs-on: ubuntu-latest
permissions:
# required to read from the repo
contents: read

steps:
- name: checkout
uses: actions/checkout@v4

- name: install updatecli
uses: updatecli/updatecli-action@v2

- name: run updatecli diff to validate config
run: |
updatecli diff --config .github/updatecli/manifest.yaml
- name: validate manifest
run: updatecli diff --config .github/updatecli/manifest.yaml

0 comments on commit 4fc68e8

Please sign in to comment.