From 2a40385e09de09a7861298a7ad169e3f16176a6d Mon Sep 17 00:00:00 2001 From: Subeom Choi Date: Tue, 25 Jun 2024 13:48:01 +0900 Subject: [PATCH] fix: solve issue that DEVELOP_BRANCH input is not used --- .github/workflows/gitflow.yml | 32 ++++++++++++++++++++++---------- changelog.md | 6 +++++- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/gitflow.yml b/.github/workflows/gitflow.yml index f9e9135..70df2af 100644 --- a/.github/workflows/gitflow.yml +++ b/.github/workflows/gitflow.yml @@ -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, @@ -330,6 +339,7 @@ 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 }}' \ @@ -337,14 +347,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 }} \ @@ -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 }} \ diff --git a/changelog.md b/changelog.md index b8ed08a..4c1a5bd 100644 --- a/changelog.md +++ b/changelog.md @@ -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