Last active
February 1, 2023 20:14
-
-
Save rcassani/2615d4a5127d37529a05518d802f6df9 to your computer and use it in GitHub Desktop.
Get last commit in GitHub repo
This file contains 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
# 1. Get all info | |
curl -s "https://api.github.com/repos/brainstorm-tools/brainstorm3/commits?per_page=1&sha=master" | |
# Parse sha | |
curl -s "https://api.github.com/repos/brainstorm-tools/brainstorm3/commits?per_page=1&sha=master" | grep -oP '(?<=^\s\s\s\s"sha":\s").*(?=")' | |
# 2. Get only sha | |
curl -s -H "Accept: application/vnd.github.sha" "https://api.github.com/repos/brainstorm-tools/brainstorm3/commits/master" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment