38
38
fi
39
39
go build -o "${output_name}" ./import/import_script.go
40
40
- name : Upload artifact
41
- uses : actions/upload-artifact@v3
41
+ uses : actions/upload-artifact@v4
42
42
with :
43
43
name : binaries
44
44
path : terraform-provider-astro-import-script_*
@@ -65,14 +65,31 @@ jobs:
65
65
uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
66
66
67
67
- name : Download artifacts
68
- uses : actions/download-artifact@v3
68
+ uses : actions/download-artifact@v4
69
69
with :
70
70
name : binaries
71
71
72
72
- name : Get the version
73
73
id : get_version
74
74
run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
75
75
76
+ - name : Generate Changelog
77
+ id : changelog
78
+ run : |
79
+ # Extract previous tag
80
+ PREVIOUS_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1))
81
+
82
+ # Generate changelog with PR numbers and authors in the desired format
83
+ CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"* %s by @%an in #%b" | \
84
+ sed -E 's/\(#[0-9]+\)//g' | \ # Remove PR numbers if they exist in commit message
85
+ sed -E 's/ */ /g' | \ # Clean up extra spaces
86
+ sed -E 's/ in #$//') # Remove trailing "in #" if no PR number
87
+
88
+ # Store changelog in output
89
+ echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
90
+ echo "$CHANGELOG" >> $GITHUB_OUTPUT
91
+ echo "EOF" >> $GITHUB_OUTPUT
92
+
76
93
- name : Create Release
77
94
id : create_release
78
95
uses : actions/create-release@v1
81
98
with :
82
99
tag_name : ${{ steps.get_version.outputs.VERSION }}
83
100
release_name : Astro Import Script ${{ steps.get_version.outputs.VERSION }}
101
+ body : |
102
+ ## What's Changed
103
+ ${{ steps.changelog.outputs.CHANGELOG }}
104
+
105
+ For full changelog, see [here](https://github.com/${{ github.repository }}/compare/${{ env.PREVIOUS_TAG }}...${{ steps.get_version.outputs.VERSION }})
84
106
draft : false
85
107
prerelease : false
86
108
0 commit comments