generated from Ed-Fi-Exchange-OSS/Template-for-GitHub
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RND-671] Fix Meadowlark CodeQL scan (#325)
* Add flag to collect coverage on unit tests * Removing vulnerability * Rename job * v0.4.0-pre.2 * Reorganize in PR steps * Updating codeql action version * Adding PR comment --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0727d95
commit 0c08a8f
Showing
13 changed files
with
273 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,56 @@ jobs: | |
name: Scan Actions | ||
uses: ed-fi-alliance-oss/ed-fi-actions/.github/workflows/repository-scanner.yml@main | ||
|
||
upgrade: | ||
# Upgrade packages on PR only to avoid a double update when pushed to main | ||
name: Upgrade packages | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: Meadowlark-js | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0w | ||
|
||
- name: Get changes | ||
id: changes | ||
run: | | ||
suggested=v$(cat lerna.json | jq -r .version) | ||
current=$(git describe --tags $(git rev-list --tags --max-count=1)) | ||
echo "Versions: Lerna: $suggested. Current: $current" | ||
echo "changes=$([[ "$suggested" != "$current" ]] && echo true)" >>$GITHUB_OUTPUT | ||
- name: Update versions | ||
if: ${{ ! steps.changes.outputs.changes }} | ||
run: npx [email protected] version prerelease --exact --no-git-tag-version --yes | ||
|
||
- name: Set Version | ||
if: ${{ ! steps.changes.outputs.changes }} | ||
id: set-version | ||
run: | | ||
version=v$(cat lerna.json | jq -r .version) | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
- uses: planetscale/ghcommit-action@4131649dbf2fdf1eb34421702972a5af7b0a8731 #v0.1.18 | ||
if: ${{ ! steps.changes.outputs.changes }} | ||
with: | ||
commit_message: "${{steps.set-version.outputs.version}}" | ||
repo: ${{ github.repository }} | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
analyze-dependencies: | ||
# This Action will fail if run on anything other than a pull request | ||
if: github.event_name == 'pull_request' | ||
name: Analyze Code Dependencies | ||
# Not mandatory, but better for this to go after the upgrade since it can change the code. | ||
needs: upgrade | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
|
@@ -48,6 +94,8 @@ jobs: | |
|
||
analyze-code: | ||
name: Analyze Code | ||
# Not mandatory, but better for this to go after the upgrade since it can change the code. | ||
needs: upgrade | ||
runs-on: ubuntu-latest | ||
env: | ||
SRC_DIR: Meadowlark-js | ||
|
@@ -79,16 +127,17 @@ jobs: | |
run: npm install | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@896079047b4bb059ba6f150a5d87d47dde99e6e5 # v2.11.6 | ||
uses: github/codeql-action/init@df32e399139a3050671466d7d9b3cbacc1cfd034 # v2.15.2 | ||
with: | ||
languages: "typescript" | ||
setup-python-dependencies: false | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@896079047b4bb059ba6f150a5d87d47dde99e6e5 # v2.11.6 | ||
uses: github/codeql-action/analyze@df32e399139a3050671466d7d9b3cbacc1cfd034 # v2.15.2 | ||
|
||
lint: | ||
name: Lint | ||
needs: upgrade | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -116,49 +165,6 @@ jobs: | |
- name: Linter | ||
run: npm run test:lint | ||
|
||
upgrade: | ||
# Upgrade packages on PR only to avoid a double update when pushed to main | ||
name: Upgrade packages | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: Meadowlark-js | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0w | ||
|
||
- name: Get changes | ||
id: changes | ||
run: | | ||
suggested=v$(cat lerna.json | jq -r .version) | ||
current=$(git describe --tags $(git rev-list --tags --max-count=1)) | ||
echo "changes=$([[ "$suggested" != "$current" ]] && echo true)" >>$GITHUB_OUTPUT | ||
- name: Update versions | ||
if: ${{ ! steps.changes.outputs.changes }} | ||
run: npx [email protected] version prerelease --exact --no-git-tag-version --yes | ||
|
||
- name: Set Version | ||
if: ${{ ! steps.changes.outputs.changes }} | ||
id: set-version | ||
run: | | ||
version=v$(cat lerna.json | jq -r .version) | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
- uses: planetscale/ghcommit-action@4131649dbf2fdf1eb34421702972a5af7b0a8731 #v0.1.18 | ||
if: ${{ ! steps.changes.outputs.changes }} | ||
with: | ||
commit_message: "${{steps.set-version.outputs.version}}" | ||
repo: ${{ github.repository }} | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
build: | ||
name: Build | ||
needs: lint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.