Skip to content

Commit

Permalink
Make it more strict to be able to merge the release
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Aug 1, 2024
1 parent 0d9f754 commit 715b314
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
merge-comment:
name: Merge release to main
runs-on: macos-14
if: github.event.issue.pull_request && github.event.comment.body == '/merge' && github.event.issue.state == 'open'
if: github.event.issue.pull_request && github.event.comment.body == '/merge' && github.event.issue.state == 'open' && endsWith(github.event.issue.title, 'Release')
steps:
- name: Connect iOS Bot
uses: webfactory/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ lane :merge_release_to_main do
comment = 'Please, wait for the `Publish new release` workflow to pass on GitHub Actions: ' \
"https://github.com/#{github_repo}/actions/workflows/release-publish.yml"
UI.important(comment)
create_pr_comment(pr_num: ENV.fetch('GITHUB_PR_NUM'), text: comment, edit_last_comment_with_text: comment)
create_pr_comment(pr_num: ENV.fetch('GITHUB_PR_NUM'), text: comment)
end

lane :merge_main_to_develop do
Expand Down Expand Up @@ -951,7 +951,7 @@ end
private_lane :create_pr_comment do |options|
if is_ci && !options[:pr_num].to_s.empty?
last_comment = sh("gh pr view #{options[:pr_num]} --json comments --jq '.comments | map(select(.author.login == \"Stream-iOS-Bot\")) | last'")
edit_last_comment = last_comment.include?(options[:edit_last_comment_with_text]) ? '--edit-last' : ''
edit_last_comment = options[:edit_last_comment_with_text] && last_comment.include?(options[:edit_last_comment_with_text]) ? '--edit-last' : ''
sh("gh pr comment #{options[:pr_num]} #{edit_last_comment} -b '#{options[:text]}'")
end
end
Expand Down

0 comments on commit 715b314

Please sign in to comment.