deskribe 0.1.0

Native Kubernetes resource descriptions using a caller-provided kube client
name: Upstream changes

on:
  schedule:
    - cron: "0 6 * * 1"
  workflow_dispatch:
    inputs:
      target:
        description: "Stable module tag, e.g. v0.37.1 (empty means latest stable)"
        required: false
        type: string
  pull_request:
    paths:
      - ".github/workflows/upstream.yaml"
      - "upstream.json"
      - "scripts/check_upstream.py"
      - "scripts/test_check_upstream.py"

permissions:
  contents: read

jobs:
  test-monitor:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - name: Checkout
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Test the monitor offline
        run: python3 -m unittest discover -s scripts -p 'test_check_upstream.py' -v

  compare:
    if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
    needs: test-monitor
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Compare upstream source
        env:
          TARGET_VERSION: ${{ inputs.target }}
        run: python3 scripts/check_upstream.py --target "$TARGET_VERSION" --output upstream-report --fail-on-changes
      - name: Upload report and patches
        if: always()
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        with:
          name: upstream-report
          path: upstream-report/
          if-no-files-found: error
          retention-days: 30