change endpoint to build latest stable only

This commit is contained in:
aptalca 2022-05-17 14:43:27 -04:00
parent 5d091aebf2
commit 86cb28249e
2 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ jobs:
- name: Build image
run: |
# Set version
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" | jq -r .tag_name | awk '{print substr($1,2); }')
PS_VERSION=$(curl -Ls -o /dev/null -w %{url_effective} https://aka.ms/powershell-release?tag=stable | sed 's|.*tag/v||g')
echo "PS_VERSION=${PS_VERSION}" >> $GITHUB_ENV
# Build image
docker build --no-cache --build-arg PS_VERSION=${PS_VERSION} -t ${{ github.sha }} .

View File

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.13 as buildstage
FROM ghcr.io/linuxserver/baseimage-alpine:3.14 as buildstage
ARG PS_VERSION
@ -7,8 +7,8 @@ RUN \
curl \
jq && \
if [ -z ${PS_VERSION+x} ]; then \
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" \
| jq -r .tag_name | awk '{print substr($1,2); }'); \
PS_VERSION=$(curl -Ls -o /dev/null -w %{url_effective} https://aka.ms/powershell-release?tag=stable \
| sed 's|.*tag/v||g'); \
fi && \
mkdir -p /root-layer/powershell && \
curl -o \