name: Push comps updates
permissions:
  contents: read

on:
  push:
    branches:
      - frawhide
      - f44
      - f43
      - f42
      - el10
    paths:
      - comps.xml
  workflow_dispatch:

jobs:
  update-comps:
    runs-on: ubuntu-24.04-arm
    container:
      image: ghcr.io/terrapkg/builder:frawhide
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Push to subatomic
        run: |
          branch=${{ github.ref_name }}
          ver=${branch/f/}
          subatomic-cli upload-comps \
            --server https://subatomic.fyralabs.com \
            --token ${{ secrets.SUBATOMIC_TOKEN }} \
            "terra${ver}" comps.xml
