Skip to content

Commit 9546c35

Browse files
committed
winget-stable: set $REF_NAME and use it instead of $GITHUB_REF_NAME
$GITHUB_REF_NAME may not be defined when triggered on workflow runs, so we need to manually export the required tag. Signed-off-by: Christian Brabandt <[email protected]>
1 parent 9be47c3 commit 9546c35

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/winget_stable.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
URL: "https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/v/vim/vim"
39+
REF_NAME: ${{ steps.get-version.outputs.tag }}
3940

4041
publish-winget-stable:
4142
runs-on: ubuntu-latest

scripts/do_next_stable_release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# and if the release number is smaller than the current Tag name + 100
77
# return true, else false
88

9-
if [[ -z "$GITHUB_REF_NAME" ]]; then
9+
if [[ -z "$REF_NAME" ]]; then
1010
echo "not run in Github Actions CI, quitting"
1111
exit 2
1212
fi
@@ -22,7 +22,7 @@ DIR="$(dirname $0)"
2222
LAST_STABLE_RELEASE=$(${DIR}/get_last_windows_release.sh "$URL" | tr -d '.')
2323
LAST_STABLE_RELEASE=$(( $LAST_STABLE_RELEASE + 100))
2424

25-
TAG_NAME=$(echo ${GITHUB_REF_NAME} |tr -d '.v')
25+
TAG_NAME=$(echo ${REF_NAME} |tr -d '.v')
2626

2727
if [[ ${TAG_NAME} -ge ${LAST_STABLE_RELEASE} ]]; then
2828
echo "true"

0 commit comments

Comments
 (0)