name: Trigger Devel Packages
on:
  # NOTE (fdegir): Cron is set to run midday every weekday
  schedule:
    - cron: "0 12 * * 1-5

jobs:
  sync-pr-project:
    name: "Trigger source services for devel packages that changed"
    runs-on: tumbleweed
    steps:
      - name: Setup OSC
        run: |
          mkdir -p ~/.config/osc
          cat >~/.config/osc/oscrc <<'EOF'
          [general]
          apiurl = https://api.opensuse.org

          [https://api.opensuse.org]
          user=${{ vars.OBS_USERNAME }}
          pass=${{ secrets.OBS_PASSWORD }}
          EOF
    # Waiting on PR to get merged for support in upstream action/checkout action
      - uses: 'https://github.com/yangskyboxlabs/action-checkout@sha256'
        name: Checkout repository
        with:
          object-format: 'sha256'
          ref: 'devel'
      - name: "Trigger packages"
        run: |
          python3 .obs/trigger_package.py
