Skip to content

Commit b030738

Browse files
committed
ci: now using GITHUB_OUTPUT in github actions
1 parent 68f0f35 commit b030738

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

.github/workflows/ci-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
uses: ./.github/workflows/release-notes-generation.yml
1313
with:
1414
# VUH_VERSION: 'v2.9.1'
15-
CHANGELOG_GENERATOR_VERSION: 'v1.0.2'
15+
CHANGELOG_GENERATOR_VERSION: 'v1.0.3'

.github/workflows/release-notes-generation.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313

1414
- name: Git clone this repo
1515
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
1618

1719
# Don't need this step here, but if you want to use same workflow in side apps your can download vuh.sh in repository folder like in commented step below:
1820
# - name: download vuh notes generator
@@ -28,31 +30,29 @@ jobs:
2830
- name: get release tag_name
2931
id: release_version
3032
run: |
31-
./vuh.sh lv -q > release_version.txt
32-
echo "{name}={value}" >> $GITHUB_OUTPUT
33-
echo "::set-output name=release_version::$(cat release_version.txt)"
33+
cur_version=$(./vuh.sh lv -q)
34+
echo "release version: $cur_version"
35+
echo "RELEASE_VERSION=$cur_version" >> "$GITHUB_OUTPUT"
3436
3537
- name: generate release notes
3638
id: changelog
3739
run: |
3840
./gen_release_notes.sh -i .. -lt -f changelog.md
39-
4041
[ -f "changelog.md" ] && CHANGELOG=$(cat changelog.md) || CHANGELOG=''
41-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
42-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
43-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
44-
echo "FINAL_CHANGELOG='$CHANGELOG'" >> $GITHUB_ENV
45-
echo "$FINAL_CHANGELOG"
42+
echo "$CHANGELOG"
43+
echo 'FINAL_CHANGELOG<<EOF' >> $GITHUB_OUTPUT
44+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
45+
echo 'EOF' >> $GITHUB_OUTPUT
4646
47-
[ -f 'changelog.md' ] && echo "::set-output name=empty::false"
48-
[ -f 'changelog.md' ] || echo "::set-output name=empty::true"
47+
[ -f 'changelog.md' ] && echo "IS_EMPTY=false" >> "$GITHUB_OUTPUT"
48+
[ -f 'changelog.md' ] || echo "IS_EMPTY=true" >> "$GITHUB_OUTPUT"
4949
5050
- name: Create Release
5151
uses: actions/create-release@v1
52-
if: ${{ steps.changelog.outputs.empty == 'false' }}
52+
if: ${{ steps.changelog.outputs.IS_EMPTY == 'false' }}
5353
env:
5454
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5555
with:
56-
tag_name: "v${{ steps.release_version.outputs.release_version }}"
57-
release_name: "v${{ steps.release_version.outputs.release_version }}"
58-
body: " $FINAL_CHANGELOG"
56+
tag_name: "v${{ steps.release_version.outputs.RELEASE_VERSION }}"
57+
release_name: "v${{ steps.release_version.outputs.RELEASE_VERSION }}"
58+
body: ${{ steps.changelog.outputs.FINAL_CHANGELOG }}

0 commit comments

Comments
 (0)