vp-build/.github/workflows/cycles.yml
Đoàn Trần Công Danh 7510b96218 common: simplify logic to find git
From chroot-git 2.33.1, we always have an executable named git
for other build infrastructure and lints.

Let's remove the shenanegan to find which git to be used, prepend the
path to chroot-git's git into $PATH, and let's the shell call the
correct git for us instead.
2022-09-17 23:32:50 +07:00

49 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/xbps-src-masterdir:20220527RC01-x86_64-musl'
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
- uses: actions/checkout@v1
with:
fetch-depth: 1
- 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: |
PATH="/usr/libexec/chroot-git:$PATH"
# required by git 2.35.2+
git config --global --add safe.directory "$PWD"
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 }}