name: Manual Purge

permissions:
  contents: read

on:
  workflow_dispatch:

jobs:
  sweepers:
    runs-on: "${{ vars.RUNS_ON || 'ubuntu-latest' }}"
    steps:
      # Checkout should always be before setup-go to ensure caching is working
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Install Go
        uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
        with:
          go-version: stable
      - name: Run Sweepers
        run: go run -v ./cmd/scw-sweeper
        env:
          SCW_DEBUG: 1
          SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
          SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
          SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
          SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
