Compare commits

...

2 Commits

Author SHA1 Message Date
LamGC
538b70656e Update LATEST_VERSION to 3283.v92c105e0f819-6
Some checks failed
Build container image / build (push) Has been cancelled
2025-01-14 01:33:04 +00:00
599c6372d8
fix: 使用 jq 以确保可以获取确切的 tag_name. 2025-01-14 09:31:37 +08:00
3 changed files with 13 additions and 3 deletions

View File

@ -19,6 +19,8 @@ jobs:
uses: actions/checkout@v3
with:
token: ${{ secrets.CHECK_UPDATES_TOKEN }}
- name: Install dependencies
run: sudo apt-get install -y jq
- name: Check updates
run: chmod +x ./update-version.sh && ./update-version.sh
- name: Get latest version

View File

@ -1 +1 @@
3283.v92c105e0f819-6

View File

@ -1,4 +1,12 @@
LATEST_VERSION=$(curl -s https://api.github.com/repos/jenkinsci/docker-agent/releases/latest | grep tag_name | cut -d '"' -f 4)
#!/bin/bash
LATEST_VERSION=$(curl -s https://api.github.com/repos/jenkinsci/docker-agent/releases/latest | jq -r '.tag_name')
CURL_EXIT_CODE=$?
if [ $CURL_EXIT_CODE -ne 0 ] || [ -z "$LATEST_VERSION" ]; then
echo "Failed to retrieve the latest version"
exit 1
fi
if [ "$LATEST_VERSION" != "$(cat LATEST_VERSION)" ]; then
echo "$LATEST_VERSION" > LATEST_VERSION
fi
fi