Skip to content

Commit 7db31c4

Browse files
authored
fix: revert release changes (#32)
<!-- Thank you for proposing a pull request! Please note that SOME TESTS WILL LIKELY FAIL due to how GitHub exposes secrets in Pull Requests from forks. Someone from the team will review your Pull Request and respond. Please describe your change and any implementation details below. -->
1 parent 2706386 commit 7db31c4

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: 'Release'
22

33
on:
44
workflow_call:
5-
secrets:
6-
ACTIONS_BOT_TOKEN:
7-
required: true
85

96
jobs:
107
release:
@@ -20,7 +17,6 @@ jobs:
2017
- name: 'Get previous release tag'
2118
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
2219
with:
23-
github-token: '${{ secrets.ACTIONS_BOT_TOKEN }}'
2420
script: |-
2521
try {
2622
const latestRelease = await github.rest.repos.getLatestRelease({
@@ -36,35 +32,11 @@ jobs:
3632
}
3733
}
3834
39-
- name: 'Generate release notes'
40-
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
41-
with:
42-
script: |-
43-
const tag = "v" + process.env.NEW_VERSION;
44-
45-
try {
46-
if (process.env.PREV_TAG) {
47-
const releaseNotes = await github.rest.repos.generateReleaseNotes({
48-
owner: context.repo.owner,
49-
repo: context.repo.repo,
50-
tag_name: tag,
51-
target_commitish: context.sha,
52-
previous_tag_name: process.env.PREV_TAG,
53-
});
54-
55-
core.exportVariable("RELEASE_NOTES", releaseNotes.data.body)
56-
}
57-
} catch (err) {
58-
core.setFailed(`Failed to generate release notes: ${err}`);
59-
}
60-
6135
- name: 'Create release'
6236
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
6337
with:
64-
github-token: '${{ secrets.ACTIONS_BOT_TOKEN }}'
6538
script: |-
6639
const tag = "v" + process.env.NEW_VERSION;
67-
const releaseNotes = process.env.RELEASE_NOTES;
6840
6941
try {
7042
const createReleaseRequest = {
@@ -76,8 +48,16 @@ jobs:
7648
generate_release_notes: true,
7749
};
7850
79-
if (releaseNotes.length) {
80-
createReleaseRequest.body = releaseNotes;
51+
if (process.env.PREV_TAG) {
52+
const releaseNotes = await github.rest.repos.generateReleaseNotes({
53+
owner: context.repo.owner,
54+
repo: context.repo.repo,
55+
tag_name: tag,
56+
target_commitish: context.sha,
57+
previous_tag_name: process.env.PREV_TAG,
58+
});
59+
60+
createReleaseRequest.body = releaseNotes.data.body;
8161
createReleaseRequest.generate_release_notes = false;
8262
}
8363

0 commit comments

Comments
 (0)