Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 686c6e6

Browse files
authored
fix(ci): revert dry run logic
1 parent 55a896b commit 686c6e6

File tree

1 file changed

+0
-69
lines changed

1 file changed

+0
-69
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
- main
66
pull_request:
77

8-
permissions:
9-
write-all
10-
118
jobs:
129
check_pr:
1310
name: "PR checks"
@@ -59,69 +56,3 @@ jobs:
5956
|| (echo "##[error] found changed files after build. please 'pnpm run generate && pnpm run build'" \
6057
"and commit all changes" \
6158
&& exit 1)
62-
63-
- name: Check semantic versioning
64-
id: semantic-release
65-
shell: bash
66-
run: |
67-
GITHUB_REF=$HEAD_REF
68-
pnpm dlx semantic-release --no-ci --dry-run --plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator --branches $HEAD_REF > output.txt
69-
OUTPUT=$(cat output.txt | base64 -w 0)
70-
echo "::set-output name=releaseNote::$OUTPUT"
71-
env:
72-
HEAD_REF: ${{ github.head_ref }}
73-
74-
- name: Report semantic versioning
75-
uses: actions/github-script@v7
76-
if: ${{ steps.semantic-release.outputs.releaseNote != '' }}
77-
with:
78-
github-token: ${{ secrets.GITHUB_TOKEN }}
79-
script: |
80-
// Build release notes.
81-
const semanticReleaseOutput = Buffer.from('${{ steps.semantic-release.outputs.releaseNote }}', 'base64').toString('utf8');
82-
const semanticReleaseLogMatch = /^[[0-9:\sAMPM]+\]\s\[semantic-release\].*$/;
83-
const lines = semanticReleaseOutput.split('\n');
84-
const lastSemanticReleaseLogIndex = [...lines]
85-
.reverse()
86-
.findIndex((line) => line.match(semanticReleaseLogMatch));
87-
88-
const releaseNoteIndex = lines.length - lastSemanticReleaseLogIndex;
89-
const releaseNote = lines.slice(releaseNoteIndex);
90-
91-
let res = releaseNote.join('\n');
92-
if (!releaseNote.length || !res) {
93-
res = '### No release note would be generated.';
94-
}
95-
96-
const SEMANTIC_RELEASE_BODY_HEADER = '## 📝 Semantic Release Report';
97-
const body = [SEMANTIC_RELEASE_BODY_HEADER, res].join('\n');
98-
99-
// Get comments on the PR.
100-
const comments = await github.issues.listComments({
101-
issue_number: context.issue.number,
102-
owner: context.repo.owner,
103-
repo: context.repo.repo
104-
});
105-
106-
// Find previous comments that were created by this step to delete.
107-
const commentsToDelete = comments.data.filter((comment) =>
108-
comment.body.startsWith(SEMANTIC_RELEASE_BODY_HEADER)
109-
);
110-
111-
// Delete eligible comments.
112-
const prms = commentsToDelete.map((comment) =>
113-
github.issues.deleteComment({
114-
comment_id: comment.id,
115-
owner: context.repo.owner,
116-
repo: context.repo.repo
117-
})
118-
);
119-
await Promise.all(prms);
120-
121-
// Create fresh new comment for release notes.
122-
github.issues.createComment({
123-
issue_number: context.issue.number,
124-
owner: context.repo.owner,
125-
repo: context.repo.repo,
126-
body
127-
});

0 commit comments

Comments
 (0)