This commit is contained in:
tremor021 2025-03-13 14:03:34 +01:00
commit c402bafadc

View File

@ -0,0 +1,42 @@
name: Crawl Versions from newreleases.io
on:
workflow_dispatch:
permissions:
contents: write
jobs:
move-to-main-repo:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
repository: community-scripts/ProxmoxVED
ref: main
- name: Crawl from newreleases.io
env:
token: ${{ secrets.NEWRELEASES_TOKEN }}
run: |
projects=$(curl -H "X-Key: $TOKEN" \
https://api.newreleases.io/v1/projects)
echo $projects > project_json
jq -r '.projects[] | "\(.id) \(.name)"' project_json | while read -r id name; do
version=$(curl -H "X-Key: $TOKEN" \
https://api.newreleases.io/v1/projects/$id/latest-release)
echo "Project Name: $name, Project ID: $id, Version: $version"
jq -n --arg name "$name" --arg version "$version" '{name: $name, version: $version}' > json/versions.json
done
- name: Commit JSON
run: |
git config --global user.email "Github Actions[bot]"
git config --global user.name "GitHub Actions"
git add json/versions.json
git commit -m "Add new script"
git push