From 472cc1adb512e6840409315c372f10ccbb2de7e4 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Thu, 13 Mar 2025 13:58:12 +0100 Subject: [PATCH] WF --- .../get-versions-from-newreleases.yaml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/get-versions-from-newreleases.yaml diff --git a/.github/workflows/get-versions-from-newreleases.yaml b/.github/workflows/get-versions-from-newreleases.yaml new file mode 100644 index 0000000..2e09aa5 --- /dev/null +++ b/.github/workflows/get-versions-from-newreleases.yaml @@ -0,0 +1,43 @@ +name: Move new Scripts to Main Repository + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + move-to-main-repo: + runs-on: ubuntu-latest + + steps: + - 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 + fi + + 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: Checkout Repository + uses: actions/checkout@v2 + with: + repository: community-scripts/ProxmoxVED + ref: main + - 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