diff --git a/.forgejo/workflows/package-check.yml b/.forgejo/workflows/package-check.yml index 2145288..67e5ae4 100644 --- a/.forgejo/workflows/package-check.yml +++ b/.forgejo/workflows/package-check.yml @@ -31,24 +31,27 @@ jobs: - uses: actions/checkout@v3 - - name: Get latest package version - id: check - run: | - main_version=$(curl -s https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz \ - | tar -xzO \ - | grep -a 'cmd:rsync=' | sed 's/.*cmd:rsync=//' | sort -V | tail -n 1) +- name: Get latest package version + id: check + run: | + main_version=$(curl -s https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz \ + | tar -xzO \ + | awk '$0=="P:rsync" { getline; if ($0 ~ /^V:/) print substr($0,3) }' \ + | sort -V | tail -n1) - community_version=$(curl -s https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz \ - | tar -xzO \ - | grep -a 'cmd:rsync=' | sed 's/.*cmd:rsync=//' | sort -V | tail -n 1) + community_version=$(curl -s https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz \ + | tar -xzO \ + | awk '$0=="P:rsync" { getline; if ($0 ~ /^V:/) print substr($0,3) }' \ + | sort -V | tail -n1) - testing_version=$(curl -s https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz \ - | tar -xzO \ - | grep -a 'cmd:rsync=' | sed 's/.*cmd:rsync=//' | sort -V | tail -n 1) + testing_version=$(curl -s https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz \ + | tar -xzO \ + | awk '$0=="P:rsync" { getline; if ($0 ~ /^V:/) print substr($0,3) }' \ + | sort -V | tail -n1) - newest_version=$(echo -e "$main_version\n$community_version\n$testing_version" | sort -V | tail -n 1) + newest_version=$(echo -e "$main_version\n$community_version\n$testing_version" | sort -V | tail -n1) - echo "NEWEST_VERSION=$newest_version" >> $GITHUB_ENV + echo "NEWEST_VERSION=$newest_version" >> $GITHUB_ENV - name: Determine if update is needed run: |