Files
actions/latest-cache/action.yml
Igor Pečovnik 774e8005d7 Update action.yml
2022-08-17 21:56:54 +02:00

25 lines
822 B
YAML

name: "Get latest cache version"
author: "Igor Pecovnik"
description: "Get latest cache version"
runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: armbian/cache
path: cache
clean: false
- name: "Get last release version from cache"
id: check-released
shell: bash
run: |
ROOTFSCACHE_VERSION=$(cd cache;gh release list --exclude-drafts | awk '{print $(NF-1)}' | sort -r | head -1)
[[ -z "$ROOTFSCACHE_VERSION" ]] && ROOTFSCACHE_VERSION="0000"
ROOTFSCACHE_VERSION=$(expr $ROOTFSCACHE_VERSION + 1)
ROOTFSCACHE_VERSION=$(printf "%04d\n" ${ROOTFSCACHE_VERSION})
echo "ROOTFSCACHE_VERSION=${ROOTFSCACHE_VERSION}" >> $GITHUB_ENV