diff --git a/.github/workflows/Generate-PR.yml b/.github/workflows/Generate-PR.yml index 101257323..b44e144c6 100644 --- a/.github/workflows/Generate-PR.yml +++ b/.github/workflows/Generate-PR.yml @@ -434,11 +434,17 @@ jobs: cat /tmp/pr.txt [[ $DRAFT_PR == 'true' ]] && export PR_DRAFT_FLAG='-d' PR_NUMBER=$(gh pr list -L 1 -s open -H ${{ inputs.branch || github.ref_name }} | cut -f1) - echo "PR title is: $(echo "${{ inputs.pr_title || inputs.branch || github.ref_name }}" | sed -e "s/^'//" -e "s/'$//") ${PKG_DELTAS}" - if [[ -z ${PR_NUMBER} ]]; then - PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "$(echo "${{ inputs.pr_title || inputs.branch || github.ref_name }}" | sed -e "s/^'//" -e "s/'$//") ${PKG_DELTAS}" -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) + PR_TITLE_INPUT="${{ inputs.pr_title }}" + if [[ -z ${PR_TITLE_INPUT} ]]; then + PR_TITLE="$(git log --oneline master..${{ inputs.branch || github.ref_name }} | grep -v "Build Run on\|Package File Update Run on" | tail -n 1 | cut -c 11-)" else - gh pr edit --add-reviewer chromebrew/active --title "$(echo "${{ inputs.pr_title || inputs.branch || github.ref_name }}" | sed -e "s/^'//" -e "s/'$//") ${PKG_DELTAS}" -F /tmp/pr.txt + PR_TITLE="${{ inputs.pr_title }}" + fi + echo "PR title is: $(echo "${PR_TITLE}" | sed -e "s/^'//" -e "s/'$//") ${PKG_DELTAS}" + if [[ -z ${PR_NUMBER} ]]; then + PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "$(echo "${PR_TITLE}" | sed -e "s/^'//" -e "s/'$//") ${PKG_DELTAS}" -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) + else + gh pr edit --add-reviewer chromebrew/active --title "$(echo "${PR_TITLE}" | sed -e "s/^'//" -e "s/'$//") ${PKG_DELTAS}" -F /tmp/pr.txt fi # Draft PRs can not be set to automerge. if [[ $DRAFT_PR == 'true' ]]; then diff --git a/tools/version.rb b/tools/version.rb index c4616787d..9dafbca15 100755 --- a/tools/version.rb +++ b/tools/version.rb @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -# version.rb version 2.1 (for Chromebrew) +# version.rb version 2.2 (for Chromebrew) OPTIONS = %w[-h --help -j --json -u --update-package-files -v --verbose] @@ -49,7 +49,11 @@ versions = [] def get_version(name, homepage, source) # Determine if the source is a GitHub repository, but skip if there # is an anitya name mapping. - unless source.nil? || source.is_a?(Hash) || %w[Pip].include?(@pkg.superclass.to_s) || CREW_ANITYA_PACKAGE_NAME_MAPPINGS.keys.find_index { |i| i == name } + unless source.nil? || %w[Pip].include?(@pkg.superclass.to_s) || CREW_ANITYA_PACKAGE_NAME_MAPPINGS.keys.find_index { |i| i == name } + if source.is_a?(Hash) + source_arch = (@pkg.source_url.keys.map &:to_s).first + source = @pkg.source_url[source_arch.to_sym] + end source.sub!('www.', '') url = URI.parse(source) if url.host == 'github.com' @@ -181,6 +185,7 @@ if filelist.length.positive? puts "#{'-------'.ljust(package_field_length)}#{'------'.ljust(status_field_length)}#{'-------'.ljust(version_field_length)}#{'--------'.ljust(version_field_length)}----------" unless OUTPUT_JSON filelist.each do |filename| @pkg = Package.load_package(filename) + cleaned_pkg_version = PackageUtils.get_clean_version(@pkg.version) if @pkg.is_fake? # Just skip is_fake packages. versions_updated[@pkg.name.to_sym] = 'Fake' @@ -351,7 +356,6 @@ if filelist.length.positive? version_status_string = 'Up to date.'.ljust(status_field_length).lightgreen end updatable_string = (updatable_pkg[@pkg.name.to_sym] == 'Yes' ? 'Yes'.lightgreen : 'No'.lightred) if updatable_string.nil? - cleaned_pkg_version = PackageUtils.get_clean_version(@pkg.version) versions.push(package: @pkg.name, update_status: versions_updated[@pkg.name.to_sym], version: cleaned_pkg_version, upstream_version: upstream_version.chomp) addendum_string = "#{@pkg.name} cannot be automatically updated: ".red + "#{updatable_pkg[@pkg.name.to_sym]}\n".purple unless updatable_pkg[@pkg.name.to_sym] == 'Yes'