2022-04-02 06:58:48 +02:00
|
|
|
name: 'Cycle Check'
|
2021-03-03 03:44:30 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 18 * * *'
|
|
|
|
|
|
|
|
jobs:
|
2021-06-23 18:45:23 +02:00
|
|
|
cycles:
|
|
|
|
runs-on: ubuntu-latest
|
2022-07-03 02:23:54 +02:00
|
|
|
permissions:
|
|
|
|
issues: write
|
2021-06-23 23:11:13 +02:00
|
|
|
container:
|
2023-01-11 15:53:12 +01:00
|
|
|
image: 'ghcr.io/void-linux/xbps-src-masterdir:20230111RC01-x86_64-musl'
|
2022-12-16 11:00:52 +01:00
|
|
|
env:
|
|
|
|
PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
|
2021-06-23 18:45:23 +02:00
|
|
|
steps:
|
2021-06-23 23:11:13 +02:00
|
|
|
- name: Prepare container
|
|
|
|
run: |
|
2022-08-05 23:06:21 +02:00
|
|
|
# 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
|
2021-06-23 23:11:13 +02:00
|
|
|
# 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
|
2021-06-29 19:58:45 +02:00
|
|
|
xbps-install -y python3-networkx github-cli
|
2022-12-16 11:00:52 +01:00
|
|
|
|
|
|
|
- name: Clone and checkout
|
|
|
|
run: |
|
|
|
|
REMOTE_REF=$(echo ${{ github.ref }} | sed 's;refs/;refs/remotes/;')
|
|
|
|
/bin/echo -e '::group::\x1b[32mCloning repository...\x1b[0m'
|
|
|
|
git clone --progress --no-checkout --filter=tree:0 \
|
|
|
|
"${{ github.server_url }}/${{ github.repository }}" "$PWD"
|
|
|
|
git config --global --add gc.auto 0
|
|
|
|
git config --global --add safe.directory "$PWD"
|
|
|
|
echo "::endgroup::"
|
|
|
|
/bin/echo -e '::group::\x1b[32mFetching repository refs...\x1b[0m'
|
|
|
|
git fetch --prune --progress --filter=tree:0 origin \
|
|
|
|
+refs/heads/*:refs/remotes/origin/* \
|
|
|
|
+${{ github.ref }}:"${REMOTE_REF}"
|
|
|
|
echo "::endgroup::"
|
|
|
|
/bin/echo -e '::group::\x1b[32mChecking out repository...\x1b[0m'
|
|
|
|
git checkout --progress --force "${REMOTE_REF}"
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
2021-06-23 23:11:13 +02:00
|
|
|
- name: Create hostrepo and prepare masterdir
|
|
|
|
run: |
|
2022-12-16 11:00:52 +01:00
|
|
|
ln -s "$(pwd)" /hostrepo &&
|
|
|
|
common/travis/set_mirror.sh &&
|
|
|
|
common/travis/prepare.sh
|
2021-06-29 19:58:45 +02:00
|
|
|
- name: Find cycles and open issues
|
|
|
|
run: |
|
2022-12-16 11:00:52 +01:00
|
|
|
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
|
2021-06-29 19:58:45 +02:00
|
|
|
env:
|
2022-12-16 11:00:52 +01:00
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
|