Skip to content

Commit

Permalink
Updated logic per Merlijn's method
Browse files Browse the repository at this point in the history
It's working locally - let's rock.
  • Loading branch information
kz6fittycent committed Dec 16, 2023
1 parent 3309a70 commit d61baee
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/sync-version-with-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ jobs:
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
update-script: |
#!/bin/bash
API="https://api.github.com/repos/jenkinsci/jenkins/releases/latest"
VERSION=$(curl -s "${API}" | grep -i name | awk 'FNR == 3 {print $2}' | cut -d ',' -f1 | sed 's/"//g')
CRAFT=$(grep -i version snap/snapcraft.yaml | awk '{print $2}' | sed 's/"//g')
# Running checks here to ensure that the version from upstream is actually a greater value than what is shown in the snapcraft.yaml
if [[ "${CRAFT}" > "${VERSION}" ]]
then
exit
else
sed -i 's/^\(version: \).*$/\1'"'$VERSION'"'/' snap/snapcraft.yaml
fi
# Grabbing latest release
VERSION=$(curl -sL https://api.github.com/repos/jenkinsci/jenkins/releases | jq .[].tag_name -r | grep -v rc | sort -r | head -n 1 | cut -d "-" -f2)
sed -i 's/^\(version: \).*$/\1'"'$VERSION'"'/' snap/snapcraft.yaml

0 comments on commit d61baee

Please sign in to comment.