Open reubensamuel opened 1 year ago
Hey @reubensamuel 👋
It looks like you haven't set the right environment variables 👀
The reason why I say this is due to this line:
2022-12-01T12:42:20.945Z ghas:inform Collecting repositories for XXXX
What did you set GITHUB_ORG
to 🤔
Hi Nick , I have blurred the organisation for confidentiality but it does pick up the org name from the variable GITHUB_ORG This is org number 1 of 1 . It seems to be failing here:
const repositoriesInOrg = (await func(
res[index].login,
graphQuery
)) as usersWriteAdminReposArray;
res[index].repos = repositoriesInOrg;
}
Does the user below require admin access to github ?
git config --global user.name "ghas-enablement"
git config --global user.email "ghas.enablement@example.com"
Thanks
Reuben
I ran into a similar issue when I updated my repos.json
file manually and accidentally used the full repo URL (e.g included full FQDN path prefixed with https://...) rather than just the subpath my-org/my-repo
For example I had a line like this in my 'repos.json' file:
"repo": "https://github.com/benhorgen/ghas-bootcamp-benhorgen"
when I should have had this:
"repo": "benhorgen/ghas-bootcamp-benhorgen"
Full example:
[
{
"login": "benhorgen",
"repos": [
{
"enableDependabot": false,
"enableDependabotUpdates": false,
"enableSecretScanning": true,
"enableCodeScanning": true,
"enablePushProtection": true,
"primaryLanguage": "python",
"createIssue": true,
"repo": "benhorgen/ghas-bootcamp-benhorgen"
}
]
}
]
Thanks Benhorgen, I have the right repo format too. Did you have to manually create the repos.json file ? I tried creating a repos.json file it said for public repos ghas is enabled automatically but for private repos asked to purchase enterprise. But doesn't configure code scanning on the public repo even though it was set to true :s . Also i tried with github app approach got Http error . Gave up on it getting it done through github apps Then i made use of PAT which worked but then above issues where we couldn't configure anything just enable. There are too many moving parts here maybe config of app or PAT could be added to the readme
Thanks Reuben
In github apps configuration could not understand the difference between APP_ID: ${{ secrets.GHAS_ENABLEMENT_APP_ID }} and APP_INSTALLATION_ID: "12345678" are they different where could i find these details
In github apps configuration could not understand the difference between APP_ID: ${{ secrets.GHAS_ENABLEMENT_APP_ID }} and APP_INSTALLATION_ID: "12345678" are they different where could i find these details
@reubensamuel The app id is visible when you are editing your GitHub app, such as:
For the installation ID, I find it easiest by going to my org's installed apps and clicking on your app. The installation ID will be in the address bar
Hi Nick
We are using the last option with action workflow file when i run the action we get the following issue any help would be highly appreciated
Run npm run getRepos
Thanks reuben