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: TOKEN: ${{ secrets.PAT_MICHEL }} run: | gh auth login --with-token <<< $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