ProxmoxVED/.github/workflows/get-versions-from-newreleases.yaml
2025-03-13 14:27:10 +01:00

46 lines
1.3 KiB
YAML

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: |
ls -l
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)
jq -n --arg name "$name" --arg version "$version" '{name: $name, version: $version}' > json/versions.json
done
- name: Commit JSON
env:
GITHUB_TOKEN: ${{ secrets.PAT_MICHEL }}
run: |
gh auth login --with-token <<< $GITHUB_TOKEN
gh auth status
git config --global user.email "michel.roegl-brunner@htl-braunau.at"
git config --global user.name "GitHub Actions[bot]"
git add json/versions.json
git commit -m "Update versions.json"
git push --force