Created
September 16, 2023 16:00
-
-
Save 0xPoe/2feabf48cee1d5571bca59c819ed8af6 to your computer and use it in GitHub Desktop.
Get your commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Set the repository and path variables | |
| repository="pingcap/tidb" | |
| path="statistics" | |
| since_date="2023-09-09T00:00:00Z" | |
| # Construct the GitHub API URL | |
| api_url="https://api.github.com/repos/$repository/commits?path=$path&since=$since_date" | |
| # Send a GET request to the GitHub API and store the response in a variable | |
| response=$(curl -s "$api_url") | |
| # Use jq to extract PR numbers and GitHub links from the commit data | |
| pr_info=$(echo "$response" | jq -r '.[] | "\(.html_url) \(.commit.url | split("/")[-4])"') | |
| # Print the PR numbers and GitHub links | |
| echo "PR numbers and their GitHub links:" | |
| echo "$pr_info" | |
| ~ | |
| ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment