Update README workflow for v1.4.x
@@ -13,12 +13,12 @@ jobs:
- name: Update README file
run: |
tmpfile=$(mktemp)
- latest13=$(curl -sL https://api.github.com/repos/rancher/rke/tags?per_page=1000 | jq -r 'first(.[] | select(.name | startswith("v1.3")) | select(.name | contains("rc") | not) | .name)')
- latest12=$(curl -sL https://api.github.com/repos/rancher/rke/tags?per_page=1000 | jq -r 'first(.[] | select(.name | startswith("v1.2")) | select(.name | contains("rc") | not) | .name)')
- echo "* v1.3" > $tmpfile
- echo " * ${latest13} - Read the full release [notes](https://github.com/rancher/rke/releases/tag/${latest13})." >> $tmpfile
- echo "* v1.2" >> $tmpfile
- echo " * ${latest12} - Read the full release [notes](https://github.com/rancher/rke/releases/tag/${latest12})." >> $tmpfile
+ wget https://api.github.com/repos/rancher/rke/tags?per_page=1000 -O tags.yaml
+ for rke_major_minor in 1.4 1.3 1.2; do
+ latest=$(jq -r 'first(.[] | select(.name | startswith("v'"${rke_major_minor}"'")) | select(.name | contains("rc") | not) | .name)' tags.yaml)
+ echo "* v${rke_major_minor}" >> $tmpfile
+ echo " * ${latest} - Read the full release [notes](https://github.com/rancher/rke/releases/tag/${latest})." >> $tmpfile
+ done
sed -e '/## Latest Release/r '"$tmpfile"'' -e 's/CURRENTYEAR/'"$(date +%Y)"'/g' README-template.md > README.md
- name: Check for repository changes
run: |
