#!/usr/bin/env bashset -efunction help() {print="To run this command,1. verify you are selecting right branch from GitHub UI dropdown menu2. enter the tag you want to create"echo "$print"exit 1}if [ -z "${GITHUB_USER}" ] || [ -z "${GITHUB_TOKEN}" ]; thenecho "requires both GITHUB_USER and GITHUB_TOKEN to be set as env variable"helpfipr_list=$(git log --pretty="%s" --merges --left-only "${FROM_BRANCH}"..."${TO_TAG}" | grep pull | awk '/Merge pull request/ {print 4ドル}' | cut -c 2-)# for releases notesfunction release_notes() {for pr in $pr_list; do# get PR titlebackport_pr=$(curl -s -u "${GITHUB_USER}":"${GITHUB_TOKEN}" "https://api.github.com/repos/rook/rook/pulls/${pr}" | jq '.title')# with upstream/release-1.6 v1.6.8, it was giving extra PR numbers, so removing after PR for changing tag is merged.if [[ "$backport_pr" =~ ./*"build: Update build version to $TO_TAG"* ]]; thenbreakfi# check if it is manual backport PR or not, for mergify backport PR it will contain "(backport"if [[ "$backport_pr" =~ .*"(backport".* ]]; then# find the PR number after the #original_pr=$(echo "$backport_pr" | sed -n -e 's/^.*#//p' | grep -E0o '[0-9]' | tr -d '\n')else# in manual backport PR, we'll directly fetch the owner and title from the PR numberoriginal_pr=$prfi# get the PR title and PR owner in required formattitle_with_user=$(curl -s -u "${GITHUB_USER}":"${GITHUB_TOKEN}" "https://api.github.com/repos/rook/rook/pulls/${original_pr}" | jq '.title+ " (#, @"+.user.login+")"')# add PR number after "#"result=$(echo "$title_with_user" | sed "s/(#/(#$original_pr/" |tail -c +2)# remove last `"`result=${result%\"}echo "$result"done}release_notes
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。