Skip to content

Commit

Permalink
instead of troubling check for ghas, allow action ussing it to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Skitionek committed Apr 17, 2024
1 parent b0ca7cc commit 640166f
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/code-quality-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,6 @@ jobs:
with:
path: config

- name: Check if GHAS is enabled
uses: actions/github-script@v7
id: ghas-enabled
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
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) {
let message = 'GitHub Advanced Security is NOT enabled.';
const url = 'https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/advanced-security-must-be-enabled';
message += ` For more information, see ${url}`;
core.warning(message);
}
return securityEnabled;
- name: Checkout Code
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -222,7 +202,7 @@ jobs:
mega-linter.log
- name: Upload MegaLinter scan results to GitHub Security tab
if: (steps.ghas-enabled.outputs.result == 'true') && (success() || failure())
continue-on-error: true
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'megalinter-reports/megalinter-report.sarif'
Expand Down

0 comments on commit 640166f

Please sign in to comment.