1
0
Fork 0
mirror of https://github.com/xHyroM/void-packages.git synced 2024-11-25 15:41:04 +01:00
void-packages/.github/workflows/cycles.yml
2024-03-29 08:12:19 +01:00

48 lines
1.6 KiB
YAML

name: 'Cycle Check'
on:
schedule:
- cron: '0 18 * * *'
jobs:
cycles:
runs-on: ubuntu-latest
permissions:
issues: write
container:
image: 'ghcr.io/void-linux/void-buildroot-musl:20231230R1'
env:
PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
steps:
- name: Prepare container
run: |
# switch to repo-ci mirror
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
# Sync and upgrade once, assume error comes from xbps update
xbps-install -Syu || xbps-install -yu xbps
# Upgrade again (in case there was a xbps update)
xbps-install -yu
# Install script dependencies
xbps-install -y python3-networkx github-cli
- name: Clone and checkout
uses: classabbyamp/treeless-checkout-action@v1
- name: Create hostrepo and prepare masterdir
run: |
ln -s "$(pwd)" /hostrepo &&
common/travis/set_mirror.sh &&
common/travis/prepare.sh
- 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 }}