12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- from_version=$1
- from=$(git log --reverse --pretty=format:"%cI" "$from_version..HEAD" | head -1)
- to=$(git merge-base origin/main HEAD | xargs git log -1 --pretty=format:"%cI")
- contributors1=$(gh api graphql --paginate -F q="repo:$GITHUB_REPOSITORY is:pr base:main is:merged merged:$from..$to" -f query='
- query($q: String!, $endCursor: String) {
- search(query: $q, type: ISSUE, first: 100, after: $endCursor) {
- edges {
- node {
- ... on PullRequest {
- author { login }
- reviews(first: 100) {
- nodes {
- author { login }
- }
- }
- comments(first: 100) {
- nodes {
- author { login }
- }
- }
- closingIssuesReferences(first: 100) {
- nodes {
- author { login }
- }
- }
- }
- }
- }
- pageInfo {
- hasNextPage
- endCursor
- }
- }
- }' --jq '.data.search.edges.[].node.author.login,
- .data.search.edges.[].node.reviews.nodes.[].author.login,
- .data.search.edges.[].node.comments.nodes.[].author.login,
- .data.search.edges.[].node.closingIssuesReferences.nodes.[].author.login')
- contributors2=$(gh api graphql --paginate -F q="repo:$GITHUB_REPOSITORY is:pr base:main is:merged merged:$from..$to" -f query='
- query($q: String!, $endCursor: String) {
- search(query: $q, type: ISSUE, first: 100, after: $endCursor) {
- edges {
- node {
- ... on PullRequest {
- body
- }
- }
- }
- pageInfo {
- hasNextPage
- endCursor
- }
- }
- }
- ' --jq '.data.search.edges.[].node.body' \
- | grep -oE "#[0-9]{4,}$|#[0-9]{4,}[^0-9<]|$GITHUB_REPOSITORY/issues/[0-9]{4,}" \
- | grep -oE "[0-9]{4,}" \
- | xargs -I{} gh issue view {} --json 'author,url' --jq '[.author.login,.url]' \
- | grep -v '/pull/' \
- | sed 's/^\["//' \
- | sed 's/".*//')
- echo "$contributors1" "$contributors2" \
- | sed 's/ /\n/g' \
- | sort -uf \
- | grep -v linux-foundation-easycla \
- | grep -v github-actions \
- | grep -v renovate \
- | grep -v opentelemetrybot \
- | sed 's/^/@/'
|