Skip to content

Commit

Permalink
fix: solve issue that DEVELOP_BRANCH input is not used (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWOF authored Jun 25, 2024
2 parents ba273a5 + 2a40385 commit 5d9d0de
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/gitflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@ jobs:
return `I recommend that you should modify ${{ env.CHANGELOG }}.`
}
})()
const response = 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)) {
return
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand Down Expand Up @@ -330,21 +339,23 @@ jobs:
gh release create $VERSION \
--generate-notes \
--notes '## Changelog'$'\n'"$CHANGELOG"$'\n' \
--target '${{ env.MAIN_BRANCH }}' \
--latest
git checkout -b '${{ env.SOURCE_BRANCH }}' '${{ env.SOURCE_COMMIT }}' \
&& git push -u origin '${{ env.SOURCE_BRANCH }}' \
|| :
PULL_REQUEST_NUMBER=$(
gh pr create \
--head '${{ env.SOURCE_BRANCH }}' \
--base 'develop' \
--title "update: ${{ env.SOURCE_BRANCH }} to develop" \
--body "update: ${{ env.SOURCE_BRANCH }} to develop" \
--base '${{ env.DEVELOP_BRANCH }}' \
--title "update: ${{ env.SOURCE_BRANCH }} to ${{ env.DEVELOP_BRANCH }}" \
--body "update: ${{ env.SOURCE_BRANCH }} to ${{ env.DEVELOP_BRANCH }}" \
| grep '\/pull\/[0-9][0-9]*' --only-matching \
| grep '[0-9][0-9]*' --only-matching
| grep '[0-9][0-9]*' --only-matching \
|| :
)
gh pr merge $PULL_REQUEST_NUMBER \
--subject "update: ${{ env.SOURCE_BRANCH }} to develop" \
--subject "update: ${{ env.SOURCE_BRANCH }} to ${{ env.DEVELOP_BRANCH }}" \
--admin \
--merge \
&& git push origin --delete ${{ env.SOURCE_BRANCH }} \
Expand All @@ -365,14 +376,15 @@ jobs:
PULL_REQUEST_NUMBER=$(
gh pr create \
--head '${{ env.SOURCE_BRANCH }}' \
--base 'develop' \
--title "update: ${{ env.SOURCE_BRANCH }} to develop" \
--body "update: ${{ env.SOURCE_BRANCH }} to develop" \
--base '${{ env.DEVELOP_BRANCH }}' \
--title "update: ${{ env.SOURCE_BRANCH }} to ${{ env.DEVELOP_BRANCH }}" \
--body "update: ${{ env.SOURCE_BRANCH }} to ${{ env.DEVELOP_BRANCH }}" \
| grep '\/pull\/[0-9][0-9]*' --only-matching \
| grep '[0-9][0-9]*' --only-matching
| grep '[0-9][0-9]*' --only-matching \
|| :
)
gh pr merge $PULL_REQUEST_NUMBER \
--subject "update: ${{ env.SOURCE_BRANCH }} to develop" \
--subject "update: ${{ env.SOURCE_BRANCH }} to ${{ env.DEVELOP_BRANCH }}" \
--admin \
--merge \
&& git push origin --delete ${{ env.SOURCE_BRANCH }} \
Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
## 2.1.2

- fix: solve issue that DEVELOP_BRANCH input is not used

## 2.1.1

- fix: solve issue that github token is not applied to github command line tool

## 2.1.0

- feature: add customizable feature.
- feature: add customizable feature

## 2.0.0

Expand Down

0 comments on commit 5d9d0de

Please sign in to comment.