Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] .github/workflows/cycles.yaml: run on PRs, don't run on forks
@ 2023-09-06  1:02 classabbyamp
  2023-09-06  1:04 ` [PR PATCH] [Updated] " classabbyamp
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: classabbyamp @ 2023-09-06  1:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages ci/cycle-lint
https://github.com/void-linux/void-packages/pull/45933

.github/workflows/cycles.yaml: run on PRs, don't run on forks
- running on forks is kinda useless and just gives people useless error messages if they sync their master branch at the wrong time
- run cycle check on PRs to catch cycles before they happen. this makes the cron cycle check more of a backup/just-in-case for things that slip past the CI

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**



A patch file from https://github.com/void-linux/void-packages/pull/45933.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci/cycle-lint-45933.patch --]
[-- Type: text/x-diff, Size: 2725 bytes --]

From cce3db1994d9aaf214399bf0ac78f968dc60b39f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:58 -0400
Subject: [PATCH] .github/workflows/cycles.yaml: run on PRs, don't run on forks

- running on forks is kinda useless and just gives people useless error
  messages if they sync their master branch at the wrong time
- run cycle check on PRs to catch cycles before they happen. this makes
  the cron cycle check more of a backup/just-in-case for things that
  slip past the CI
---
 .github/workflows/cycles.yml | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/cycles.yml b/.github/workflows/cycles.yml
index 8eaecdc70287b..e80b97eb723e9 100644
--- a/.github/workflows/cycles.yml
+++ b/.github/workflows/cycles.yml
@@ -3,11 +3,18 @@ name: 'Cycle Check'
 on:
   schedule:
     - cron: '0 18 * * *'
+  pull_request:
+    paths:
+      - 'srcpkgs/**'
 
 jobs:
   cycles:
     runs-on: ubuntu-latest
+    # run only if on the main repo or on pull requests
+    if: ${{ github.event_name == 'pull_request' || github.repository_owner == 'void-linux' }}
     permissions:
+      # this will only apply to scheduled runs
+      # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
       issues: write
     container:
       image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
@@ -24,7 +31,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # Install script dependencies
-          xbps-install -y python3-networkx github-cli
+          xbps-install -y python3-networkx
 
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
@@ -34,9 +41,13 @@ jobs:
           ln -s "$(pwd)" /hostrepo &&
           common/travis/set_mirror.sh &&
           common/travis/prepare.sh
-      - name: Find cycles and open issues
+      - name: Find cycles
         run: |
           common/scripts/xbps-cycles.py | tee cycles
+      - name: Open issues
+        if: ${{ github.event_name == 'schedule' }}
+        run: |
+          xbps-install -y github-cli
           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"
@@ -46,3 +57,11 @@ jobs:
           done
         env:
           GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
+      - run: |
+          if [ -s cycles ]; then
+            echo "Build cycles found:"
+            cat cycles
+            exit 42
+          else
+            echo "No cycles found"
+          fi

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-12-07  3:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06  1:02 [PR PATCH] .github/workflows/cycles.yaml: run on PRs, don't run on forks classabbyamp
2023-09-06  1:04 ` [PR PATCH] [Updated] " classabbyamp
2023-09-06  1:16 ` classabbyamp
2023-09-06  3:02 ` classabbyamp
2023-09-06  3:03 ` classabbyamp
2023-09-06  3:13 ` classabbyamp
2023-09-06  3:14 ` classabbyamp
2023-09-07 16:08 ` [PR PATCH] [Updated] " classabbyamp
2023-09-07 16:09 ` classabbyamp
2023-09-07 16:12 ` classabbyamp
2023-09-07 16:27 ` classabbyamp
2023-09-07 16:29 ` classabbyamp
2023-09-07 16:31 ` classabbyamp
2023-09-07 16:44 ` classabbyamp
2023-09-07 16:53 ` Chocimier
2023-09-07 16:58 ` [PR PATCH] [Updated] " classabbyamp
2023-09-07 17:22 ` classabbyamp
2023-12-07  1:46 ` github-actions
2023-12-07  3:13 ` [PR PATCH] [Closed]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).