name: pkgcheck
on:
  schedule:
    - cron: "3 * * * *"
  push:
    branches: [master]
  pull_request:
    branches:
      - master

jobs:
  pkgcheck:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v5
        with:
          fetch-depth: 0

      - name: Tree-wide pkgcheck pentoo-ci
        uses: pkgcore/pkgcheck-action@v1
        with:
          args: -C PentooCI --exit PentooCI --net

      - name: Tree-wide pkgcheck error check
        uses: pkgcore/pkgcheck-action@v1
        with:
          args: --net --exit error -k error,PkgMetadataXmlIndentation,DeprecatedManifestHash,UnusedInherits,-NonsolvableDepsInStable,-NonsolvableDepsInDev,-NonsolvableDepsInExp,-PotentialStable,-DeprecatedDep,-MissingUseDepDefault,UnknownProfilePackageUse,OldPackageUpdate,OldMultiMovePackageUpdate,LaggingProfileEapi,UnknownProfilePackageKeywords,-UnusedProfileDirs,UnquotedVariable,VisibleVcsPkg,NonexistentDeps,-MasterPackageClobbered

      - name: Commit pkgcheck warnings
        uses: pkgcore/pkgcheck-action@v1
        with:
          args: --net --exit warning -k ,PkgMetadataXmlIndentation,-NonsolvableDepsInStable,-NonsolvableDepsInDev,-PotentialStable,-UnknownProfilePackage,-DeprecatedDep,-MissingUseDepDefault,ProfileError,ProfileWarning,UnknownProfilePackageUse,OldPackageUpdate,OldMultiMovePackageUpdate,LaggingProfileEapi,UnknownProfilePackageKeywords,-UnusedProfileDirs,EclassReservedName,VisibleVcsPkg,DeprecatedEapi,MissingRemoteId,DistutilsNonPEP517Build,OldPackageNameDep,NonexistentDeps,-MasterPackageClobbered --commits HEAD^..${{ github.sha }}
