1 個回答
- 最新
- 最多得票
- 最多評論
0
Hi there,
Hope you are doing well! I understand you want to know if there is a filter on the CodeCommit Console so you can filter out PullRequests activities.
Currently, there is no filter on the CodeCommit Console. Alternatively, you may consider using AWS API/CLI command, which can filter it using the following script:
RepoName="RepoName" #Please change the Repo name
todate="2022-12-20" #Please change the date you want to find by
todateN=$(date -d $todate +%s)
aws codecommit list-pull-requests --repository-name $RepoName | jq -c '.pullRequestIds[]' | while read prID; do
prNumber=$(echo "${prID//\"}") # remove "
prDetetails=$(aws codecommit get-pull-request --pull-request-id $prNumber)
# echo $prDetetails | jq '.pullRequest.lastActivityDate'
prNumber=$(echo "${prID//\"}") # remove "
prLastActivityDateTime=$(echo $prDetetails | jq '.pullRequest.lastActivityDate')
prLastActivityDate=$(echo $prLastActivityDateTime| awk '{ print substr( $0, 2, length($0)-24 ) }')
# echo prLastActivityDate: $prLastActivityDate
prLastActivityDateN=$(date -d $prLastActivityDate +%s)
#echo prLastActivityDate: $prLastActivityDate $prLastActivityDateN
if [ $prLastActivityDateN -ge $todateN ];
then
echo $prDetetails | jq '.pullRequest | "\(.pullRequestId) \(.lastActivityDate)"'
fi
done
Please note that the code above is for your use-case reference only, effort for developing and debugging your own code is required.
已回答 2 年前
相關內容
- AWS 官方已更新 4 個月前
- AWS 官方已更新 1 年前