-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,6 +187,7 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.SOURCE_BRANCH }} | ||
token: ${{ env.TOKEN }} | ||
|
||
- name: Checkout commit | ||
|
@@ -203,6 +204,15 @@ jobs: | |
run: | | ||
cat ${{ env.CHANGELOG }} \ | ||
| grep '^${{ env.VERSION_HEADER }}Unreleased$' \ | ||
|| ( \ | ||
echo "$(printf '${{ env.VERSION_HEADER }}Unreleased\n\n' | cat - ${{ env.CHANGELOG }})" > ${{ env.CHANGELOG }}; \ | ||
git config user.name github-actions; \ | ||
git config user.email [email protected]; \ | ||
git add ${{ env.CHANGELOG }}; \ | ||
git commit -m "document: add Unreleased to ${{ env.CHANGELOG }}"; \ | ||
git push; \ | ||
) \ | ||
&& (echo 'warning=changelog-not-modified' >> $GITHUB_OUTPUT; exit 0) \ | ||
|| (echo 'failure=changelog-not-contains-unreleased' >> $GITHUB_OUTPUT; exit 1) | ||
git diff --name-only ${{ env.DESTINATION_COMMIT }} \ | ||
| grep --perl-regexp 'changelog\.md' \ | ||
|
@@ -246,13 +256,12 @@ jobs: | |
return `I recommend that you should modify ${{ env.CHANGELOG }}.` | ||
} | ||
})() | ||
const response = await github.rest.issues.listComments({ | ||
const { data: comments } = await github.rest.issues.listComments({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
const comments = response.map(json => json.body) | ||
if (comments.some(comment => comment === message)) { | ||
}) | ||
if (comments.some(comment => comment.body === message)) { | ||
return | ||
} | ||
github.rest.issues.createComment({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 2.2.2 | ||
|
||
- document: add Unreleased to changelog.md | ||
|
||
## 2.2.1 | ||
|
||
- fix: use TOKEN instead of GITHUB_TOKEN | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters