@@ -20,108 +20,108 @@ jobs:
2020 contents : write
2121 pull-requests : write
2222 steps :
23- - name : Checkout
24- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25- with :
26- persist-credentials : false
27-
28- - name : Configure Git
29- run : |
30- git config user.name "github-actions[bot]"
31- git config user.email "github-actions[bot]@users.noreply.github.com"
32-
33-
34- - name : Setup Node.js
35- uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
36- with :
37- node-version : ' lts/*'
38- check-latest : true
39- package-manager-cache : false
23+ - name : Checkout
24+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+ with :
26+ persist-credentials : false
27+
28+ - name : Configure Git
29+ run : |
30+ git config user.name "github-actions[bot]"
31+ git config user.email "github-actions[bot]@users.noreply.github.com"
32+
33+
34+ - name : Setup Node.js
35+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
36+ with :
37+ node-version : ' lts/*'
38+ check-latest : true
39+ package-manager-cache : false
4040
41- - uses : pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
42- with :
43- run_install : |
44- - recursive: true
45- args: [--frozen-lockfile]
46-
47- # No need to install dependencies - npm version works without them
48- - name : Version bump
49- id : version
50- run : |
51- VERSION=$(pnpm version "$VERSION_TYPE" --no-git-tag-version)
52- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
53- pnpm --recursive exec pnpm pkg set version=$(node -p "JSON.parse(fs.readFileSync('package.json', 'utf8')).version")
54- pnpm install --no-frozen-lockfile
55- env :
56- VERSION_TYPE : ${{ github.event.inputs.version }}
41+ - uses : pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
42+ with :
43+ run_install : |
44+ - recursive: true
45+ args: [--frozen-lockfile]
46+
47+ # No need to install dependencies - npm version works without them
48+ - name : Version bump
49+ id : version
50+ run : |
51+ VERSION=$(pnpm version "$VERSION_TYPE" --no-git-tag-version)
52+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
53+ pnpm --recursive exec pnpm pkg set version=$(node -p "JSON.parse(fs.readFileSync('package.json', 'utf8')).version")
54+ pnpm install --no-frozen-lockfile
55+ env :
56+ VERSION_TYPE : ${{ github.event.inputs.version }}
5757
58- - uses : actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
59- id : app-token
60- with :
61- app -id : ${{ vars.APP_ID }}
62- private-key : ${{ secrets.PRIVATE_KEY }}
58+ - uses : actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
59+ id : app-token
60+ with :
61+ client -id : ${{ vars.APP_CLIENT_ID }}
62+ private-key : ${{ secrets.PRIVATE_KEY }}
6363
64- - name : Get release notes
65- id : release-notes
66- run : |
67- # Get the default branch
68- DEFAULT_BRANCH=$(gh api "repos/$GITHUB_REPOSITORY" --jq '.default_branch')
69-
70- # Get the latest release tag using GitHub API
71- # Use the exit code to determine if a release exists
72- if LAST_TAG=$(gh api "repos/$GITHUB_REPOSITORY/releases/latest" --jq '.tag_name' 2>/dev/null); then
73- echo "Previous release found: $LAST_TAG"
74- else
75- LAST_TAG=""
76- echo "No previous releases found - this will be the first release"
77- fi
78-
79- # Generate release notes - only include previous_tag_name if we have a valid previous tag
80- echo "Generating release notes for tag: $VERSION"
81- if [ -n "$LAST_TAG" ]; then
82- echo "Using previous tag: $LAST_TAG"
83- RELEASE_NOTES=$(gh api \
84- --method POST \
85- -H "Accept: application/vnd.github+json" \
86- "/repos/$GITHUB_REPOSITORY/releases/generate-notes" \
87- -f "tag_name=$VERSION" \
88- -f "target_commitish=$DEFAULT_BRANCH" \
89- -f "previous_tag_name=$LAST_TAG" \
90- --jq '.body')
91- else
92- echo "Generating notes from all commits"
93- RELEASE_NOTES=$(gh api \
94- --method POST \
95- -H "Accept: application/vnd.github+json" \
96- "/repos/$GITHUB_REPOSITORY/releases/generate-notes" \
97- -f "tag_name=$VERSION" \
98- -f "target_commitish=$DEFAULT_BRANCH" \
99- --jq '.body')
100- fi
101-
102- # Set release notes as environment variable
103- echo "RELEASE_NOTES<<EOF" >> "$GITHUB_OUTPUT"
104- echo "$RELEASE_NOTES" >> "$GITHUB_OUTPUT"
105- echo "EOF" >> "$GITHUB_OUTPUT"
106- env :
107- GH_TOKEN : ${{ github.token }}
108- VERSION : ${{ steps.version.outputs.version }}
109- GITHUB_REPOSITORY : ${{ github.repository }}
64+ - name : Get release notes
65+ id : release-notes
66+ run : |
67+ # Get the default branch
68+ DEFAULT_BRANCH=$(gh api "repos/$GITHUB_REPOSITORY" --jq '.default_branch')
69+
70+ # Get the latest release tag using GitHub API
71+ # Use the exit code to determine if a release exists
72+ if LAST_TAG=$(gh api "repos/$GITHUB_REPOSITORY/releases/latest" --jq '.tag_name' 2>/dev/null); then
73+ echo "Previous release found: $LAST_TAG"
74+ else
75+ LAST_TAG=""
76+ echo "No previous releases found - this will be the first release"
77+ fi
78+
79+ # Generate release notes - only include previous_tag_name if we have a valid previous tag
80+ echo "Generating release notes for tag: $VERSION"
81+ if [ -n "$LAST_TAG" ]; then
82+ echo "Using previous tag: $LAST_TAG"
83+ RELEASE_NOTES=$(gh api \
84+ --method POST \
85+ -H "Accept: application/vnd.github+json" \
86+ "/repos/$GITHUB_REPOSITORY/releases/generate-notes" \
87+ -f "tag_name=$VERSION" \
88+ -f "target_commitish=$DEFAULT_BRANCH" \
89+ -f "previous_tag_name=$LAST_TAG" \
90+ --jq '.body')
91+ else
92+ echo "Generating notes from all commits"
93+ RELEASE_NOTES=$(gh api \
94+ --method POST \
95+ -H "Accept: application/vnd.github+json" \
96+ "/repos/$GITHUB_REPOSITORY/releases/generate-notes" \
97+ -f "tag_name=$VERSION" \
98+ -f "target_commitish=$DEFAULT_BRANCH" \
99+ --jq '.body')
100+ fi
101+
102+ # Set release notes as environment variable
103+ echo "RELEASE_NOTES<<EOF" >> "$GITHUB_OUTPUT"
104+ echo "$RELEASE_NOTES" >> "$GITHUB_OUTPUT"
105+ echo "EOF" >> "$GITHUB_OUTPUT"
106+ env :
107+ GH_TOKEN : ${{ github.token }}
108+ VERSION : ${{ steps.version.outputs.version }}
109+ GITHUB_REPOSITORY : ${{ github.repository }}
110110
111- - name : Create Pull Request
112- uses : peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
113- env :
114- RELEASE_NOTES : ${{ steps.release-notes.outputs.RELEASE_NOTES }}
115- VERSION : ${{ steps.version.outputs.version }}
116- with :
117- branch : release/${{ steps.version.outputs.version }}
118- delete-branch : true
119- title : " Release ${{ steps.version.outputs.version }}"
120- body : |
121- ${{ env.RELEASE_NOTES }}
122- commit-message : " chore: release ${{ steps.version.outputs.version }}"
123- labels : |
124- Type: Release
125- assignees : ${{ github.actor }}
126- token : ${{ steps.app-token.outputs.token }}
127- draft : true
111+ - name : Create Pull Request
112+ uses : peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
113+ env :
114+ RELEASE_NOTES : ${{ steps.release-notes.outputs.RELEASE_NOTES }}
115+ VERSION : ${{ steps.version.outputs.version }}
116+ with :
117+ branch : release/${{ steps.version.outputs.version }}
118+ delete-branch : true
119+ title : " Release ${{ steps.version.outputs.version }}"
120+ body : |
121+ ${{ env.RELEASE_NOTES }}
122+ commit-message : " chore: release ${{ steps.version.outputs.version }}"
123+ labels : |
124+ Type: Release
125+ assignees : ${{ github.actor }}
126+ token : ${{ steps.app-token.outputs.token }}
127+ draft : true
0 commit comments