-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scripts/prepare_changelog: Replace python for with gh and jq commands #12689
Conversation
0fdd24d
to
3e1b89a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but overall this LGTM!
scripts/prepare_changelog.sh
Outdated
if [ -z $LAST_RELEASE ]; then | ||
echo "you need to give the previous release version. prepare_changelog.sh v<version>" | ||
exit 1 | ||
fi | ||
|
||
if ! (($+commands[jq])); then | ||
DO_PR_CHECK=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the variable is not used, I believe we can remove it?
scripts/prepare_changelog.sh
Outdated
git log HEAD...${LAST_RELEASE} --first-parent --oneline --grep="Merge pull request #[0-9]\+" --grep="(#[0-9]\+)$" | | ||
grep -o "#\([0-9]\+\)" | awk -F\# '{print $2}' | while read line | ||
release_time="$(gh release view --json "createdAt" --jq '.createdAt' ${LAST_RELEASE})" | ||
gh pr list -s merged -S "merged:>=$release_time -label:documentation -label:automated -label:tech-debt -label:website -label:legal -label:docs -author:hc-github-team-packer" --json "number" --jq '.[]|.number' | while read line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation looks mixed between spaces and tabs, doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple more nits, but aside from that LGTM, feel free to merge when you're ready
fi | ||
rm -f pull.json | ||
vared -ch ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That command's a total mystery to me, what's vared
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a zsh function that drops zsh into a temp editor. The value typed in before hitting return will be assigned to the value ok. It looks like this is being used as a way to make the command interactive. Otherwise it just prints all the line entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made one change to it for now.
This change uses the GitHub CLI to obtain all pull-requests merged after the latest release to help with updating the Packer CHANGELOG.
2d836f7
to
3201a97
Compare
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This change uses the GitHub CLI to obtain all pull-requests merged after the latest release to help with updating the Packer CHANGELOG.