direnv: update to 2.35.0.
[void-pkg.git] / .github / workflows / cycles.yml
blob00f7eb4709d83584e5b8db5674e411c102026240
1 name: 'Cycle Check'
3 on:
4   schedule:
5     - cron: '0 18 * * *'
7 jobs:
8   cycles:
9     runs-on: ubuntu-latest
10     permissions:
11       issues: write
12     container:
13       image: 'ghcr.io/void-linux/void-buildroot-musl:20240526R1'
14       env:
15         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
16     steps:
17       - name: Prepare container
18         run: |
19           # switch to repo-ci mirror
20           mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
21           sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
22           # Sync and upgrade once, assume error comes from xbps update
23           xbps-install -Syu || xbps-install -yu xbps
24           # Upgrade again (in case there was a xbps update)
25           xbps-install -yu
26           # Install script dependencies
27           xbps-install -y python3-networkx github-cli
29       - name: Clone and checkout
30         uses: classabbyamp/treeless-checkout-action@v1
32       - name: Create hostrepo and prepare masterdir
33         run: |
34           ln -s "$(pwd)" /hostrepo &&
35           common/travis/set_mirror.sh &&
36           common/travis/prepare.sh
37       - name: Find cycles and open issues
38         run: |
39           common/scripts/xbps-cycles.py | tee cycles
40           grep 'Cycle:' cycles | while read -r line; do
41               if gh issue list -R "$GITHUB_REPOSITORY" -S "$line" | grep .; then
42                   printf "Issue on '%s' already exists.\n" "$line"
43               else
44                   gh issue create -R "$GITHUB_REPOSITORY" -b '' -t "$line"
45               fi
46           done
47         env:
48           GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}