Skip to content
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

Try to fix analyze/build for examples #177

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/example-build-deploy-dockerfile-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
repositories: 'core'

- name: Checkout core repository
id: checkout
uses: actions/checkout@v4
with:
repository: '3lvia/core'
Expand All @@ -57,13 +56,11 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
project-file: ${{ env.PROJECT_FILE }}
trivy-upload-report: 'true'
trivy-upload-report: 'false'
trivy-post-comment: 'true'
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }}
# START REMOVE FROM EXAMPLE
checkout: 'false'
trivy-results-ref: ${{ steps.checkout.outputs.ref }}
trivy-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE

deploy-dev:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/example-build-deploy-dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:

- name: Checkout core repository
uses: actions/checkout@v4
id: checkout
with:
repository: '3lvia/core'
token: ${{ steps.app-token.outputs.token }}
Expand All @@ -57,13 +56,11 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
project-file: ${{ env.PROJECT_FILE }}
trivy-upload-report: 'true'
trivy-upload-report: 'false'
trivy-post-comment: 'true'
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }}
# START REMOVE FROM EXAMPLE
checkout: 'false'
trivy-results-ref: ${{ steps.checkout.outputs.ref }}
trivy-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE

deploy-dev:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/example-build-deploy-dotnet-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
language: 'csharp'
# START REMOVE FROM EXAMPLE
checkout: 'false'
upload-results: 'false'
ref: ${{ steps.checkout.outputs.ref }}
sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE
Expand Down Expand Up @@ -178,13 +179,11 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
project-file: ${{ env.PROJECT_FILE }}
trivy-upload-report: 'true'
trivy-upload-report: 'false'
trivy-post-comment: 'true'
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }}
# START REMOVE FROM EXAMPLE
checkout: 'false'
trivy-results-ref: ${{ steps.checkout.outputs.ref }}
trivy-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE

deploy-dev:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/example-build-deploy-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
language: 'csharp'
# START REMOVE FROM EXAMPLE
checkout: 'false'
upload-resport: 'false'
codeql-results-ref: ${{ steps.checkout.outputs.ref }}
codeql-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE
Expand Down Expand Up @@ -166,7 +167,6 @@ jobs:

- name: Checkout core repository
uses: actions/checkout@v4
id: checkout
with:
repository: '3lvia/core'
token: ${{ steps.app-token.outputs.token }}
Expand All @@ -176,13 +176,11 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
project-file: ${{ env.PROJECT_FILE }}
trivy-upload-report: 'true'
trivy-upload-report: 'false'
trivy-post-comment: 'true'
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }}
# START REMOVE FROM EXAMPLE
checkout: 'false'
trivy-results-ref: ${{ steps.checkout.outputs.ref }}
trivy-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE

deploy-dev:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/example-build-deploy-go-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
language: 'go'
# START REMOVE FROM EXAMPLE
checkout: 'false'
upload-results: 'false'
codeql-results-ref: ${{ steps.checkout.outputs.ref }}
codeql-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE
Expand Down Expand Up @@ -87,7 +88,6 @@ jobs:

- name: Checkout core repository
uses: actions/checkout@v4
id: checkout
with:
repository: '3lvia/core'
token: ${{ steps.app-token.outputs.token }}
Expand All @@ -97,13 +97,11 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
project-file: ${{ env.PROJECT_FILE }}
trivy-upload-report: 'true'
trivy-upload-report: 'false'
trivy-post-comment: 'true'
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }}
# START REMOVE FROM EXAMPLE
checkout: 'false'
trivy-results-ref: ${{ steps.checkout.outputs.ref }}
trivy-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE

deploy-dev:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/example-build-deploy-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
language: 'go'
# START REMOVE FROM EXAMPLE
checkout: 'false'
upload-results: 'true'
codeql-results-ref: ${{ steps.checkout.outputs.ref }}
codeql-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE
Expand Down Expand Up @@ -87,7 +88,6 @@ jobs:

- name: Checkout core repository
uses: actions/checkout@v4
id: checkout
with:
repository: '3lvia/core'
token: ${{ steps.app-token.outputs.token }}
Expand All @@ -97,13 +97,11 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
project-file: ${{ env.PROJECT_FILE }}
trivy-upload-report: 'true'
trivy-upload-report: 'false'
trivy-post-comment: 'true'
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }}
# START REMOVE FROM EXAMPLE
checkout: 'false'
trivy-results-ref: ${{ steps.checkout.outputs.ref }}
trivy-results-sha: ${{ steps.checkout.outputs.commit }}
# END REMOVE FROM EXAMPLE

deploy-dev:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/update-starter-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
sed -i 's/branches: \[trunk\]/branches: \[$default-branch\]/g' "$new_workflow_path"
sed -i "s/checkout: 'false'.*\$//g" "$new_workflow_path"

# We disable Trivy uploading report in testing, so reenable here.
sed -i "s/trivy-upload-report: 'false'/trivy-upload-report: 'true'/g" "$new_workflow_path"

# We checkout core repo to test on demo apps, so we remove this part from the examples.
perl -0777 -i -pe 's/# START REMOVE FROM EXAMPLE.*?# END REMOVE FROM EXAMPLE\n//gms' "$new_workflow_path"

Expand Down
5 changes: 5 additions & 0 deletions analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
description: 'Language to run CodeQL analyze on. Use a matrix strategy to run for multiple languages.'
required: false
default: 'csharp'
upload-results:
description: 'If `true` the action will upload CodeQL results to GitHub Security Code Scanning. If `false`, the action will not upload results.'
required: false
default: 'true'
codeql-results-ref:
description: |
The ref where CodeQL results will be uploaded. Defaults to `github.ref`.
Expand Down Expand Up @@ -75,3 +79,4 @@ runs:
with:
ref: ${{ inputs.codeql-results-ref == '' && github.ref || inputs.codeql-results-ref }}
sha: ${{ inputs.codeql-results-sha == '' && github.sha || inputs.codeql-results-sha }}
upload-database: ${{ inputs.upload-results }}
Loading