Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 2.2.2 #20

Merged
merged 5 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/gitflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.SOURCE_BRANCH }}
token: ${{ env.TOKEN }}

- name: Checkout commit
Expand All @@ -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' \
Expand Down Expand Up @@ -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({
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
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
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ changelog.md
```

1. Create (`${FEATURE_TYPE}/name` to `develop`) pull request.
2. GitHub Actions automatically check changelog.md has `## Unreleased`, if not close pull request.
2. GitHub Actions automatically check changelog.md has `## Unreleased`, if possible add `## Unreleased` to changelog.md and commit and push, if not close pull request.
3. GitHub Actions automatically check changelog.md has modification, if not add recommend comment to pull request.
4. Merge.
5. GitHub Actions automatically delete `${FEATURE_TYPE}/name` branch.
Expand Down
Loading