Skip to content

Commit

Permalink
Merge pull request #606 from NIHGOV/staging
Browse files Browse the repository at this point in the history
Add repository_selection to organization setting entities.
  • Loading branch information
furniturewalatkNIH authored Aug 15, 2024
2 parents ed8448c + 6aed215 commit abf794c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .github/scripts/Create-PSQLUpdate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ foreach ($item in $data) {
else {
$processed_description = $orgData.description
}

if ($item.repository_selection -ne "all") {
Write-Output "Org $($item.account.login) does not have all repositories selected. This can cause issues with the portal."
Throw "Org $($item.account.login) does not have all repositories selected. This can cause issues with the portal."
}
$insertData += [PSCustomObject]@{
type = @("public", "private", "internal")
active = $true
Expand All @@ -60,6 +63,7 @@ foreach ($item in $data) {
@{
appId = $item.app_id
installationId = $item.id
repositoryAccess = $item.repository_selection
}
)
organizationid = $item.account.id
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/staging_update_orgsettings_table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,23 @@ jobs:
PEM: ${{ secrets.DEV_APP_PEM }}
APPID: ${{ secrets.DEV_APP_ID }}


# JC Note: This version of this step is not working changing to use curl like for production
# - name: run gh cli to get app install info
# run: |
# gh api --paginate \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer $(cat token)" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# app/installations | jq >> app_output.json
- name: run gh cli to get app install info
run: |
gh api --paginate \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $(cat token)" \
-H "X-GitHub-Api-Version: 2022-11-28" \
app/installations | jq >> app_output.json
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $(cat token)" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/app/installations?per_page=100 | jq >> app_output.json
cat ./app_output.json
# needs a PAT that can read org and enterprise data
- name: run powershell script to build sql
run: |
Expand Down

0 comments on commit abf794c

Please sign in to comment.