Skip to content

Commit

Permalink
fix: update tools team-id (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigilioso authored Dec 18, 2024
1 parent 876ec1f commit aaf5a8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ fi

ORG="newrelic";
# https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#get-a-team-by-name
# gh api /orgs/newrelic/teams/coreint | jq .id
TEAM_ID="3626876";
# gh api /orgs/newrelic/teams/ohai | jq .id
TEAM_ID="11525403";

reference_status () {
REPOSITORY_SLUG="$1"
Expand Down
8 changes: 7 additions & 1 deletion tools/list-not-released-prereleases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ source "$(dirname $(readlink -f $0))/common-functions.sh"
# Listing all repositories that start with `nri-` that belongs to coreint
gh api --paginate "/teams/${TEAM_ID}/repos" --jq '.[] | select(.name | startswith("nri-")) | .name' | \
while read REPO_NAME; do
echo " Checking $REPO_NAME..."
# Get the date of the latest release.
LATEST_RELEASE_DATE=$(
gh release list --json publishedAt,isLatest -R "${ORG}/${REPO_NAME}" --jq '
.[] | select(.isLatest) | .publishedAt | fromdateiso8601
'
)

if [ -z "$LATEST_RELEASE_DATE" ]; then
echo " No releases found for \"${REPO_NAME}\" (probably not an OHAI repository)"
continue
fi

# List all releases, filter by prereleases that was made later than the latest release, sort by date,
# reverse because the last one is the most recent and only grab the last prerelease
NON_PUBLISHED_PRERELEASES=$(
Expand All @@ -25,7 +31,7 @@ while read REPO_NAME; do
'
)
if ! [ -z "${NON_PUBLISHED_PRERELEASES}" ]; then
# Next querie uses the list release API endpoint:
# Next query uses the list release API endpoint:
# https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases

# gh list release is limited only to fields createdAt, isDraft, isLatest, isPrerelease, name, publishedAt, and tagName
Expand Down

0 comments on commit aaf5a8e

Please sign in to comment.