-
Notifications
You must be signed in to change notification settings - Fork 0
Add shipshape audit workflow #66
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bb0254e
Add shipshape audit workflow and permissions to tide_build.yml
MarkCalvert b1a5ae6
Updated shipshape to not throw error code and fail the job
MarkCalvert 84cdf50
Refactor shipshape workflow to use curl for downloading SDP Platform …
MarkCalvert cbef937
Add input for shipshape audit execution in tide_build workflow
MarkCalvert b874b5b
Formatted file
MarkCalvert 2eda536
Refactor shipshape workflow to use new configuration file structure a…
MarkCalvert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: shipshape | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| # Add permissions block | ||
| permissions: | ||
| checks: write | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| audit: | ||
| name: shipshape_audit | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/dpc-sdp/bay/ci-builder:6.x | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Audit codebase | ||
| shell: bash | ||
| run: | | ||
| # Run shipshape | ||
| shipshape run . -f .github/workflows/shipshape/shipshape.yml --output-format table --output-file shipshape-results.xml --output-file-format junit > shipshape-results.txt | ||
| - name: Upload audit report | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| path: shipshape-results.txt | ||
| - name: Publish junit report | ||
| uses: mikepenz/action-junit-report@v5 | ||
| if: always() | ||
| with: | ||
| report_paths: shipshape-results.xml | ||
| check_name: Junit Shipshape Audit Report | ||
| fail_on_failure: false | ||
| require_tests: false | ||
| require_passed_tests: false | ||
| annotate_only: false |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| collect: | ||
| #--------------------------------------------------------------------------- | ||
| # CORE EXTENSION CONFIGURATION | ||
| #--------------------------------------------------------------------------- | ||
| # File containing core extension configuration | ||
| core-extension-file: | ||
| file:read: | ||
| path: config/sync/core.extension.yml | ||
|
|
||
| # Get the list of modules | ||
| modules: | ||
| yaml:key: | ||
| input: core-extension-file | ||
| path: module | ||
| keys-only: true | ||
|
|
||
| # Get the site profile | ||
| profile: | ||
| yaml:key: | ||
| input: core-extension-file | ||
| path: profile | ||
| ignore-not-found: true | ||
|
|
||
| #--------------------------------------------------------------------------- | ||
| # LAGOON CONFIGURATION | ||
| #--------------------------------------------------------------------------- | ||
| # Lagoon configuration file | ||
| lagoon-file: | ||
| file:read: | ||
| path: .lagoon.yml | ||
|
|
||
| # TLS-ACME settings for different environments | ||
| production-tls-acme: | ||
| yaml:key: | ||
| input: lagoon-file | ||
| path: production_routes.active.routes[0].nginx-php[0].*.tls-acme | ||
| ignore-not-found: true | ||
|
|
||
| master-tls-acme: | ||
| yaml:key: | ||
| input: lagoon-file | ||
| path: environments.master.routes[0].nginx-php[0].*.tls-acme | ||
| ignore-not-found: true | ||
|
|
||
| uat-tls-acme: | ||
| yaml:key: | ||
| input: lagoon-file | ||
| path: environments.uat.routes[0].nginx-php[0].*.tls-acme | ||
| ignore-not-found: true | ||
|
|
||
| develop-tls-acme: | ||
| yaml:key: | ||
| input: lagoon-file | ||
| path: environments.develop.routes[0].nginx-php[0].*.tls-acme | ||
| ignore-not-found: true | ||
|
|
||
| analyse: | ||
| #--------------------------------------------------------------------------- | ||
| # MODULE CHECKS | ||
| #--------------------------------------------------------------------------- | ||
| lagoon-logs-check: | ||
| allowed:list: | ||
| description: "Lagoon logs module is not enabled" | ||
| input: modules | ||
| required: | ||
| - lagoon_logs | ||
| severity: high | ||
|
|
||
| #--------------------------------------------------------------------------- | ||
| # PROFILE CHECKS | ||
| #--------------------------------------------------------------------------- | ||
| tide-profile-check: | ||
| regex:not-match: | ||
| description: "Verify Tide profile is correctly set" | ||
| input: profile | ||
| pattern: "^tide$" | ||
| severity: high | ||
|
|
||
| #--------------------------------------------------------------------------- | ||
| # TLS-ACME CHECKS | ||
| #--------------------------------------------------------------------------- | ||
| production-tls-acme-check: | ||
| regex:not-match: | ||
| description: "Verify TLS-ACME is enabled for the production environment" | ||
| input: production-tls-acme | ||
| pattern: "^false$" | ||
| severity: high | ||
|
|
||
| master-tls-acme-check: | ||
| regex:not-match: | ||
| description: "Verify TLS-ACME is enabled for the master environment" | ||
| input: master-tls-acme | ||
| pattern: "^false$" | ||
| severity: high | ||
|
|
||
| uat-tls-acme-check: | ||
| regex:not-match: | ||
| description: "Verify TLS-ACME is enabled for the UAT environment" | ||
| input: uat-tls-acme | ||
| pattern: "^false$" | ||
| severity: high | ||
|
|
||
| develop-tls-acme-check: | ||
| regex:not-match: | ||
| description: "Verify TLS-ACME is enabled for the develop environment" | ||
| input: develop-tls-acme | ||
| pattern: "^false$" | ||
| severity: high |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.