Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
onk authored Jan 12, 2025
2 parents 84e847c + c0f7623 commit 3f38bf2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ on:
jobs:
test:
runs-on: ubuntu-latest
container: ${{ matrix.ruby }}
strategy:
fail-fast: false
matrix:
ruby:
- ruby:2.6
- ruby:2.7
- ruby:3.0
- ruby:3.1
- ruby:3.2
- rubylang/ruby:master-nightly-bionic
include:
- ruby: rubylang/ruby:master-nightly-bionic
allow_failures: "true"
- "2.6"
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- head

steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache vendor/bundle
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor/bundle
key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion lib/git/pr/release/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def merge_pr_body(old_body, new_body)
merged_body = pr_body_lines.join("\n")
check_status.each { |issue_number, check_value|
say "Update pull-request checkbox \##{issue_number} to #{check_value}.", :trace
merged_body.gsub! /^- \[ \] \##{issue_number}/, "- [#{check_value}] \##{issue_number}"
merged_body.gsub! /^- \[ \] \##{issue_number}\b/, "- [#{check_value}] \##{issue_number}"
}

merged_body
Expand Down
20 changes: 20 additions & 0 deletions spec/git/pr/release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@
MARKDOWN
}
end
context "new pr added when the same numbers are included in a forward match" do
it {
actual = merge_pr_body(<<~OLD_BODY, <<~NEW_BODY)
- [x] #3 Provides a creating release pull-request object for template @hakobe
- [ ] #6 Support two factor auth @ninjinkun
OLD_BODY
- [ ] #3 Provides a creating release pull-request object for template @hakobe
- [ ] #4 use user who create PR if there is no assignee @hakobe
- [ ] #6 Support two factor auth @ninjinkun
- [ ] #30 Extract logic from bin/git-pr-release @banyan
NEW_BODY

expect(actual).to eq <<~MARKDOWN.chomp
- [x] #3 Provides a creating release pull-request object for template @hakobe
- [ ] #4 use user who create PR if there is no assignee @hakobe
- [ ] #6 Support two factor auth @ninjinkun
- [ ] #30 Extract logic from bin/git-pr-release @banyan
MARKDOWN
}
end
end

describe "#host_and_repository_and_scheme" do
Expand Down

0 comments on commit 3f38bf2

Please sign in to comment.