2022-04-02 04:58:48 +00:00
|
|
|
name: 'Cycle Check'
|
2021-03-03 02:44:30 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 18 * * *'
|
|
|
|
|
|
|
|
jobs:
|
2021-06-23 16:45:23 +00:00
|
|
|
cycles:
|
|
|
|
runs-on: ubuntu-latest
|
2021-06-23 21:11:13 +00:00
|
|
|
container:
|
|
|
|
image: 'ghcr.io/void-linux/xbps-src-masterdir:20210313rc01-x86_64-musl'
|
2021-06-23 16:45:23 +00:00
|
|
|
steps:
|
2021-06-23 21:11:13 +00:00
|
|
|
- name: Prepare container
|
|
|
|
run: |
|
|
|
|
# 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 17:58:45 +00:00
|
|
|
xbps-install -y python3-networkx github-cli
|
2021-06-23 21:11:13 +00:00
|
|
|
- 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
|
2021-06-29 17:58:45 +00:00
|
|
|
- name: Find cycles and open issues
|
|
|
|
run: |
|
2022-04-26 19:31:22 +00:00
|
|
|
if command -v chroot-git >/dev/null 2>&1; then
|
|
|
|
GIT_CMD=$(command -v chroot-git)
|
|
|
|
elif command -v git >/dev/null 2>&1; then
|
|
|
|
GIT_CMD=$(command -v git)
|
|
|
|
fi
|
|
|
|
# required by git 2.35.2+
|
|
|
|
$GIT_CMD config --global --add safe.directory "$PWD"
|
2021-06-29 17:58:45 +00: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
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
|