Skip to content

Commit 1c774af

Browse files
authored
Update main.yml test #GITBUILD
1 parent c48c9c1 commit 1c774af

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/main.yml

+20-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
steps:
2222
- name: Check Commit and Install 7Zip PowerShell Module
2323
shell: powershell
24-
2524
run: |
2625
# cancel early, if not build commit
2726
$strVal ='${{ github.event.commits[0].message }}'
@@ -35,6 +34,7 @@ jobs:
3534
exit(1)
3635
}
3736
Install-Module 7Zip4PowerShell -Force -Verbose
37+
3838
- uses: actions/checkout@v2
3939

4040
- name: Restore NuGet packages
@@ -51,7 +51,22 @@ jobs:
5151
- name: Get current date and time
5252
id: datetime
5353
run: echo "::set-output name=current_datetime::$(date +'%d/%m/%Y %H:%M')"
54-
54+
55+
# New step to get previous tag and commits
56+
- name: Get commits since last release
57+
id: get_commits
58+
run: |
59+
# Get the most recent tag (assuming releases are tagged)
60+
PREV_TAG=$(git describe --tags --abbrev=0)
61+
echo "Previous tag: $PREV_TAG"
62+
63+
# List commits since last tag
64+
COMMITS=$(git log $PREV_TAG..HEAD --pretty=format:"* %s")
65+
echo "Commits since last release: $COMMITS"
66+
67+
# Save commits to output for use in the release body
68+
echo "::set-output name=commits::${COMMITS}"
69+
5570
- name: Create Release
5671
id: create_release
5772
uses: actions/create-release@latest
@@ -62,6 +77,9 @@ jobs:
6277
release_name: ${{ steps.datetime.outputs.current_datetime }} (${{ github.run_number }})
6378
body: |
6479
Automated Release by GitHub Action CI
80+
81+
### Commits in this release:
82+
${{ steps.get_commits.outputs.commits }}
6583
draft: false
6684
prerelease: false
6785

@@ -75,4 +93,3 @@ jobs:
7593
asset_path: ./UnityLauncherPro.zip
7694
asset_name: UnityLauncherPro.zip
7795
asset_content_type: application/zip
78-

0 commit comments

Comments
 (0)