Skip to content

Check AI Namespace Repository Descriptions and Catalog Inclusion #74

Check AI Namespace Repository Descriptions and Catalog Inclusion

Check AI Namespace Repository Descriptions and Catalog Inclusion #74

name: Check AI Namespace Repository Descriptions and Catalog Inclusion
on:
schedule:
- cron: '0 9 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
check-descriptions:
name: Check Repository Descriptions and Catalog Inclusion
runs-on: ubuntu-latest
outputs:
script_output: ${{ steps.check-script.outputs.script_output }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run description check script
id: check-script
run: |
./scripts/check-namespace-descriptions.sh --namespace ai 2>&1 | tee script.log
exit_code=${PIPESTATUS[0]}
output=$(cat script.log)
{
echo 'script_output<<EOF'
echo "$output"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
exit $exit_code
check-catalog:
name: Check Catalog Inclusion
runs-on: ubuntu-latest
outputs:
catalog_script_output: ${{ steps.catalog-check-script.outputs.catalog_script_output }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run catalog inclusion check script
id: catalog-check-script
run: |
./scripts/check-ai-catalog-inclusion.sh --namespace ai 2>&1 | tee catalog-script.log
exit_code=${PIPESTATUS[0]}
output=$(cat catalog-script.log)
{
echo 'catalog_script_output<<EOF'
echo "$output"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
exit $exit_code
report-status:
name: Report and Notify
runs-on: ubuntu-latest
needs: [check-descriptions, check-catalog]
if: always() # <-- Ensures the job runs regardless of prior failures
steps:
- name: Show script output
run: |
echo "${{ needs.check-descriptions.outputs.script_output }}"
- name: Show catalog script output
run: |
echo "${{ needs.check-catalog.outputs.catalog_script_output }}"
- name: Notify Slack on failure
if: |
needs.check-descriptions.result == 'failure' || needs.check-catalog.result == 'failure'
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: ":warning: Docker Hub AI Namespace Check Failed"
blocks:
- type: "section"
text:
type: "mrkdwn"
text: ":warning: *Docker Hub AI Namespace Check Failed*"
- type: "section"
text:
type: "mrkdwn"
text: ${{ toJson(format('```{0}```', needs.check-descriptions.outputs.script_output)) }}
- type: "section"
text:
type: "mrkdwn"
text: ${{ toJson(format('```{0}```', needs.check-catalog.outputs.catalog_script_output)) }}
- type: "section"
text:
type: "mrkdwn"
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow Logs>"