From 4fc5144f8e49dc28e7fbb554a657303bc8670b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 29 Jun 2021 19:58:45 +0200 Subject: .github/workflows: open issue when cycle is detected --- .github/workflows/cron.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c284857efcb..1b53808a758 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 }} -- cgit v1.2.3