WF
This commit is contained in:
parent
a81f3cce0d
commit
472cc1adb5
43
.github/workflows/get-versions-from-newreleases.yaml
vendored
Normal file
43
.github/workflows/get-versions-from-newreleases.yaml
vendored
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user