forked from void-linux/void-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 2.45 KB
/
cycles.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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'
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
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::"
- 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 }}