hotfix: set version to tag if commitid is empty in github action workflow

This commit is contained in:
fengcaiwen
2024-10-09 22:57:48 +08:00
committed by naison
parent 1005075367
commit bc960987ea
2 changed files with 12 additions and 0 deletions

View File

@@ -47,6 +47,9 @@ jobs:
- name: Build
run: |
export VERSION=${{github.event.pull_request.head.sha}}
if [[ -z "$VERSION" ]]; then
export VERSION=${{ github.sha }}
fi
make kubevpn-linux-amd64
chmod +x ./bin/kubevpn
cp ./bin/kubevpn /usr/local/bin/kubevpn

View File

@@ -22,6 +22,9 @@ jobs:
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker buildx create --use
export VERSION=${{github.event.pull_request.head.sha}}
if [[ -z "$VERSION" ]]; then
export VERSION=${{ github.sha }}
fi
make container-test
linux:
runs-on: ubuntu-latest
@@ -62,6 +65,9 @@ jobs:
- name: Build
run: |
export VERSION=${{github.event.pull_request.head.sha}}
if [[ -z "$VERSION" ]]; then
export VERSION=${{ github.sha }}
fi
make kubevpn-linux-amd64
chmod +x ./bin/kubevpn
cp ./bin/kubevpn /usr/local/bin/kubevpn
@@ -132,6 +138,9 @@ jobs:
- name: Build
run: |
export VERSION=${{github.event.pull_request.head.sha}}
if [[ -z "$VERSION" ]]; then
export VERSION=${{ github.sha }}
fi
make kubevpn-darwin-amd64
chmod +x ./bin/kubevpn
cp ./bin/kubevpn /usr/local/bin/kubevpn