How in CI to know if GHAS is enabled #56252
Unanswered
jcook-uptycs
asked this question in
Code Security
Replies: 2 comments
This comment was marked as spam.
This comment was marked as spam.
-
I wrote this step for that. - name: Check if GHAS is enabled
uses: actions/github-script@v7
id: ghas-enabled
with:
script: |
const response = await github.rest.repos.get({
owner: '${{ github.repository }}'.split("/")[0],
repo: '${{ github.repository }}'.split("/")[1]
});
const securityEnabled = response.data.security_and_analysis?.advanced_security?.status === 'enabled';
if (!securityEnabled) {
const message = 'GitHub Advanced Security is NOT enabled.';
core.warning(message);
}
return securityEnabled; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
I'm trying to figure out in a GitHub action/workflow how to know if GitHub advanced security is enabled.
I can't find it in a the github context.
Beta Was this translation helpful? Give feedback.
All reactions