-
Notifications
You must be signed in to change notification settings - Fork 66
58 lines (51 loc) · 2.07 KB
/
prowlarr-ci.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
name: Update Prowlarr Supported Indexers
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update-wiki:
runs-on: ubuntu-latest
if: github.repository == 'Servarr/Wiki'
permissions:
contents: write
env:
API_KEY: fakeapikey
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pip packages
run: |
pip3 install -U --no-cache-dir \
requests==2.31.0 \
pycountry==23.12.11 \
python_iso639==2024.2.7
- name: Update supported indexers markdown
run: |
echo "<Config><LaunchBrowser>False</LaunchBrowser><ApiKey>${{ env.API_KEY }}</ApiKey></Config>" | tee prowlarr-config.xml
docker run -d --rm --name=prowlarr -e TZ=Etc/UTC -p 9696:9696 -v "$(pwd)/prowlarr-config.xml":/config/config.xml ghcr.io/linuxserver/prowlarr:nightly
sleep 15
APP_VERSION=$(curl -sL "http://localhost:9696/api?apikey=${{ env.API_KEY }}" -I | awk 'BEGIN {RS="\r\n"; FS=": "}/^X-Application-Version/{print $2}')
echo "PROWLARR_VERSION=$APP_VERSION" >> $GITHUB_ENV
echo "PROWLARR_VERSION=$APP_VERSION" >> $GITHUB_STEP_SUMMARY
python scripts/convert_prowlarr_supported_indexers_to_markdown.py -k "${{ env.API_KEY }}" -u "http://localhost:9696" -o "prowlarr/supported-indexers.md" -s "prowlarr/supported-indexers.md.hash"
docker stop prowlarr
- name: Commit changes
run: |
git config --global user.name "Servarr"
git config --global user.email "development@lidarr.audio"
git add prowlarr/supported-indexers.md
git add prowlarr/supported-indexers.md.hash
if git status | grep -q modified
then
git commit -m "[script] supported indexers $(date --iso-8601=seconds)"
git push
else
echo "No changes since last run"
fi