-
Notifications
You must be signed in to change notification settings - Fork 12
Merge Master to Main #2934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Merge Master to Main #2934
Conversation
…bom/org.springframework-spring-web-6.0.23
Update dev-efiling-api-build-4.yaml
Update dev-efiling-api-build-4.yaml
Artifactory
…bom/org.springframework-spring-web-6.0.23
…/efiling-bom/org.springframework-spring-web-6.0.23 Bump org.springframework:spring-web from 6.0.19 to 6.0.23 in /src/backend/libs/efiling-bom
fix frontend vulnerabilities
fix frontend vulnerability
…ng-demo/semver-5.7.2
…ng-frontend/http-proxy-middleware-2.0.9
…end/efiling-frontend/http-proxy-middleware-2.0.9 Bump http-proxy-middleware from 2.0.7 to 2.0.9 in /src/frontend/efiling-frontend
…rg.apache.tomcat.embed-tomcat-embed-core-11.0.10
…ing-api/org.apache.tomcat.embed-tomcat-embed-core-11.0.10 Bump org.apache.tomcat.embed:tomcat-embed-core from 11.0.8 to 11.0.10 in /src/backend/efiling-api
…ven.plugins-maven-surefire-plugin-3.5.3
…apache.maven.plugins-maven-surefire-plugin-3.5.3 Bump org.apache.maven.plugins:maven-surefire-plugin from 2.22.2 to 3.5.3 in /src/backend
…' into feature/vulnerability-updates-25
Starters Version Update
| name: Build and Test Java | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| FILE_COUNTER: 0 | ||
| CC_TEST_REPORTER_ID: 9ada3133fe9babf91a222009998b3545b7eae897a05900930bfa8a27fd82f385 | ||
| ACTION_DEBUG: true | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| # Get Code Climate binary | ||
| - name: Download Code Climate Binary | ||
| run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
|
|
||
| # Permissions applied to the Code Climate Executable | ||
| - name: Apply executable perms to Code Climate Binary | ||
| run: chmod +x ./cc-test-reporter | ||
|
|
||
| # Before build | ||
| - name: Before build | ||
| run: ./cc-test-reporter before-build | ||
|
|
||
| # Set required Git env vars for either pull request | ||
| - name: Set ENV for codeclimate (pull_request) | ||
| run: | | ||
| echo "::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}" | ||
| echo "::set-env name=GIT_COMMIT_SHA::${{ github.event.pull_request.head.sha }}" | ||
| if: github.event_name == 'pull_request' | ||
|
|
||
| # Set required Git env vars for a push to master | ||
| - name: Set ENV for codeclimate (push) | ||
| run: | | ||
| echo "::set-env name=GIT_BRANCH::$GITHUB_REF" | ||
| echo "::set-env name=GIT_COMMIT_SHA::$GITHUB_SHA" | ||
| if: github.event_name == 'push' | ||
|
|
||
| # Trimming the ref to master in order to publish correct report (paambaati) | ||
| - name: Set ref/head/master to master | ||
| run: | | ||
| echo "::set-env name=GIT_BRANCH::master" | ||
| if: env.GIT_BRANCH == 'refs/heads/master' | ||
|
|
||
| - name: Checkout Spring Starters Repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: bcgov/spring-boot-starters | ||
| path: spring-boot-starters | ||
| ref: v1.0.5 | ||
|
|
||
| # Setup Java Environment | ||
| - name: Set up JDK 1.8 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v1 | ||
| with: | ||
| java-version: 1.8 | ||
| - uses: actions/cache@v1 | ||
| with: | ||
| path: ~/.m2/repository | ||
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-maven- | ||
| java-version: 17 | ||
|
|
||
| # Run Maven Verify to generate all jacoco reports | ||
| - name: Build with Maven | ||
| run: mvn -B verify -P all --file src/backend/pom.xml | ||
| # TODO REMOVE AFTER SFTP IS IN MAVEN CENTRAL | ||
| - name: Build Spring Starters | ||
| run: mvn install -P all --file ./spring-boot-starters/src/pom.xml | ||
|
|
||
| # Loop through all BACKEND services to show that jacoco reports have been generated | ||
| - name: WHERE AM I - BACKEND? | ||
| run: | | ||
| for s in efiling-backend-demo efiling-api | ||
| do | ||
| ls ${{ github.workspace }}/src/backend/$s/target/site/jacoco; | ||
| done | ||
| if: ${{ env.ACTION_DEBUG }} | ||
| - name: Checkout File Submission Repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
| # Formatting the BACKEND coverage reports generated (dynamically) | ||
| - name: Format BACKEND coverage reports | ||
| run: | | ||
| projectRelRegex="^\.\/src\/backend\/(.*)\/target\/site\/jacoco\/jacoco\.xml$" | ||
| for file in $(find . -name "jacoco.xml") | ||
| do | ||
| echo $file | ||
| echo $projectRelRegex | ||
| if [[ $file =~ $projectRelRegex ]] | ||
| then | ||
| projectRel="${BASH_REMATCH[1]}" | ||
| echo "analyzing project: " $projectRel | ||
| projectName="${projectRel//\//-}" | ||
| JACOCO_SOURCE_PATH=${{ github.workspace }}/src/backend/$projectRel/src/main/java ./cc-test-reporter format-coverage ${{github.workspace}}/src/backend/$projectRel/target/site/jacoco/jacoco.xml --input-type jacoco --output coverage/$projectName-codeclimate.json; | ||
| echo "coverage generated: coverage/$projectName-codeclimate.json;" | ||
| else | ||
| echo $file does not match | ||
| fi | ||
| done | ||
| # List all formatted files in coverage directory | ||
| - name: WHERE AM I - FORMATTED? | ||
| run: | | ||
| ls ${{ github.workspace }}/coverage | ||
| if: ${{ env.ACTION_DEBUG }} | ||
|
|
||
| # Count of all total coverage files available | ||
| - name: Count files present | ||
| run: | | ||
| echo "::set-env name=FILE_COUNTER::$(ls -1q ./coverage | wc -l )" | ||
| # Sum the coverage reports | ||
| - name: Summing the coverage reports generated | ||
| run: ./cc-test-reporter sum-coverage coverage/*-codeclimate.json -p ${{ env.FILE_COUNTER }} -o coverage/total-codeclimate.json | ||
|
|
||
| # Upload JSON for debugging purposes | ||
| - name: Upload JSON for debugging purposes | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: summed-java-coverage-report | ||
| path: coverage/total-codeclimate.json | ||
|
|
||
| aggregation: | ||
| name: Aggregate Spring Boot and Javascript reports | ||
| needs: [yarn, spring-boot] | ||
| env: | ||
| CC_TEST_REPORTER_ID: 9ada3133fe9babf91a222009998b3545b7eae897a05900930bfa8a27fd82f385 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Get Code Climate binary | ||
| - name: Download Code Climate Binary | ||
| run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
|
|
||
| # Permissions applied to the Code Climate Executable | ||
| - name: Apply executable perms to Code Climate Binary | ||
| run: chmod +x ./cc-test-reporter | ||
|
|
||
| # Before build | ||
| - name: Before build | ||
| run: ./cc-test-reporter before-build | ||
|
|
||
| # Set required Git env vars for either pull request | ||
| - name: Set ENV for codeclimate (pull_request) | ||
| run: | | ||
| echo "::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}" | ||
| echo "::set-env name=GIT_COMMIT_SHA::${{ github.event.pull_request.head.sha }}" | ||
| if: github.event_name == 'pull_request' | ||
|
|
||
| # Set required Git env vars for a push to master | ||
| - name: Set ENV for codeclimate (push) | ||
| run: | | ||
| echo "::set-env name=GIT_BRANCH::$GITHUB_REF" | ||
| echo "::set-env name=GIT_COMMIT_SHA::$GITHUB_SHA" | ||
| if: github.event_name == 'push' | ||
|
|
||
| # Trimming the ref to master in order to publish correct report (paambaati) | ||
| - name: Set ref/head/master to master | ||
| run: | | ||
| echo "::set-env name=GIT_BRANCH::master" | ||
| echo "GIT_BRANCH=master" >> $GITHUB_ENV | ||
| #echo "::set-env name=GIT_BRANCH::master" | ||
| if: env.GIT_BRANCH == 'refs/heads/master' | ||
|
|
||
| # Make Directory for downloaded files | ||
| - name: Make directory | ||
| run: mkdir coverage-reports | ||
|
|
||
| # Download Spring-boot coverage report | ||
| - name: Download spring-boot coverage report | ||
| uses: actions/download-artifact@v1 | ||
| with: | ||
| name: summed-java-coverage-report | ||
|
|
||
| # See what is inside | ||
| - name: List items inside java coverage report object | ||
| run: | | ||
| ls summed-java-coverage-report | ||
| # Copy total java to outside directory | ||
| - name: Copy Java Coverage to directory | ||
| run: | | ||
| cp summed-java-coverage-report/total-codeclimate.json coverage-reports/total-java-codeclimate.json | ||
| # Download Yarn coverage report | ||
| - name: Download javascript coverage report | ||
| uses: actions/download-artifact@v1 | ||
| with: | ||
| name: summed-yarn-coverage-report | ||
|
|
||
| # See what is inside | ||
| - name: List items inside java coverage report object | ||
| run: | | ||
| ls summed-yarn-coverage-report | ||
| # Copy total Yarn to outside directory | ||
| - name: Copy Yarn Coverage to directory | ||
| run: | | ||
| cp summed-yarn-coverage-report/total-codeclimate.json coverage-reports/total-yarn-codeclimate.json | ||
| #- uses: actions/cache@v1 | ||
| # with: | ||
| # path: ~/.m2/repository | ||
| # key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
| # restore-keys: | | ||
| # ${{ runner.os }}-maven- | ||
|
|
||
| # See what is inside coverage | ||
| - name: List items inside java coverage report object | ||
| run: | | ||
| ls coverage-reports | ||
| # Sum the coverage reports | ||
| - name: Summing the coverage reports generated | ||
| run: ./cc-test-reporter sum-coverage coverage-reports/*-codeclimate.json -p 2 -o coverage-reports/total-codeclimate.json | ||
|
|
||
| # Upload JSON for debugging purposes | ||
| - name: Upload JSON for debugging purposes | ||
| uses: actions/upload-artifact@v2 | ||
| #Set env again?? | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v1 | ||
| with: | ||
| name: summed-total-coverage-report | ||
| path: coverage-reports/total-codeclimate.json | ||
| java-version: 17 | ||
|
|
||
| # Upload total coverage report to Code Climate | ||
| - name: Upload coverage report to Code Climate | ||
| run: ./cc-test-reporter upload-coverage -i coverage-reports/total-codeclimate.json | ||
| # Run Maven Verify to generate all jacoco reports | ||
| - name: Build with Maven | ||
| run: mvn -B verify -P all --file src/backend/pom.xml |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
To fix this issue, add a permissions block specifying the least privilege required to the workflow. The best way is to add the block at the top level—below the name: or on: field—if all jobs have the same minimal need. According to CodeQL’s suggestion and the job description, the appropriate permission is contents: read, since the jobs only need to read the repository code. If, in the future, a job requires additional permissions (e.g., to update issues or pull requests), then elevate privileges only for that specific job. For this fix, add:
permissions:
contents: readdirectly below the name: (after line 1), or just after the on: block (after line 8), so it applies to all jobs. No changes to other imports or actions are required.
-
Copy modified lines R9-R10
| @@ -6,6 +6,8 @@ | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| yarn: | ||
| env: |
Move to SNAPSHOT
Description
This PR includes the following proposed change(s):
Type of change
if your change is a breaking change, please add
breaking changelabel to this PRHow Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Does the change impact or break the Docker build?
If Yes: Has Docker been updated accordingly?
Checklist: