diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c284857efc..1b53808a75 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -25,7 +25,7 @@ jobs: # Upgrade again (in case there was a xbps update) xbps-install -yu # Install script dependencies - xbps-install -y python3-networkx + xbps-install -y python3-networkx github-cli - uses: actions/checkout@v1 with: fetch-depth: 1 @@ -34,4 +34,15 @@ jobs: ln -s "$(pwd)" /hostrepo && common/travis/set_mirror.sh && common/travis/prepare.sh - - run: common/scripts/xbps-cycles.py + - name: Find cycles and open issues + run: | + common/scripts/xbps-cycles.py | tee cycles + grep 'Cycle:' cycles | while read -r line; do + if gh issue list -R "$GITHUB_REPOSITORY" -S "$line" | grep .; then + printf "Issue on '%s' already exists.\n" "$line" + else + gh issue create -R "$GITHUB_REPOSITORY" -b '' -t "$line" + fi + done + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}