Skip to content

Commit 6ace8c2

Browse files
committed
Fix build arg of BUILD_REF for docker Images
1 parent 3e05777 commit 6ace8c2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/release-nu-image.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
uses: actions/checkout@v4
2626
with:
2727
ref: main
28+
fetch-depth: 0
2829

2930
- name: Set up Nushell
3031
uses: hustcer/setup-nu@v3
@@ -47,11 +48,14 @@ jobs:
4748
- name: "Set tag & labels for ${{ github.ref }}"
4849
shell: nu {0}
4950
run: |
50-
$'BUILD_REF=(git rev-parse --short HEAD)(char nl)' o>> $env.GITHUB_ENV
51-
$'BUILD_DATE=(date now | format date %Y-%m-%dT%H:%M:%SZ)(char nl)' o>> $env.GITHUB_ENV
5251
let tagName = http get https://api.github.com/repos/nushell/nushell/releases
5352
| sort-by -r created_at | select tag_name | get tag_name.0
53+
git remote set-url origin https://github.com/nushell/nushell.git
54+
git fetch origin --tags
55+
let SHA = git rev-list -n 1 $tagName | str substring 0..7
56+
$'BUILD_REF=($SHA)(char nl)' o>> $env.GITHUB_ENV
5457
$'NU_VERSION=($tagName)(char nl)' o>> $env.GITHUB_ENV
58+
$'BUILD_DATE=(date now | format date %Y-%m-%dT%H:%M:%SZ)(char nl)' o>> $env.GITHUB_ENV
5559
5660
- name: Build and Push Debian Image
5761
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)