-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add docker-hadolint and docker-trivy analysis
- Loading branch information
1 parent
deb288e
commit 0529e86
Showing
4 changed files
with
127 additions
and
21 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
docker_registry: ghcr.io | ||
license: mit | ||
ci: github | ||
maintainers: | ||
|
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
# Code generated by craft; DO NOT EDIT. | ||
|
||
name: Go Integration | ||
run-name: Go Integration | ||
name: Integration | ||
run-name: Integration | ||
|
||
on: | ||
- push | ||
- workflow_dispatch | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- staging | ||
- develop | ||
- v[0-9]+ | ||
- v[0-9]+.[0-9]+ | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
|
@@ -20,6 +27,10 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- id: sha | ||
run: echo "sha=$(echo "${{ github.ref_name }}" | sha256sum | cut -c -8)" >> $GITHUB_OUTPUT | ||
- id: regexp | ||
run: | | ||
echo "ref=$(echo "${{ github.ref }}" | sed 's#\/#\\/#g')" >> $GITHUB_OUTPUT | ||
echo "ref_name=$(echo "${{ github.ref_name }}" | sed 's#\/#\\/#g')" >> $GITHUB_OUTPUT | ||
- id: semantic_release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
|
@@ -44,7 +55,8 @@ jobs: | |
{ "name": "alpha", "prerelease": true }, | ||
{ "name": "staging", "prerelease": "beta" }, | ||
{ "name": "develop", "prerelease": "alpha" }, | ||
{ "name": "${{ github.ref_name }}", "prerelease": "${{ steps.sha.outputs.sha }}" } | ||
{ "name": "${{ steps.regexp.outputs.ref }}", "prerelease": "${{ steps.sha.outputs.sha }}" }, | ||
{ "name": "${{ steps.regexp.outputs.ref_name }}", "prerelease": "${{ steps.sha.outputs.sha }}" } | ||
] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -98,4 +110,43 @@ jobs: | |
fail_ci_if_error: true | ||
file: coverage.out | ||
slug: ${{ github.repository }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
docker-hadolint: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
security-events: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: hadolint/[email protected] | ||
continue-on-error: true # enforce scan upload to codeql | ||
with: | ||
format: sarif | ||
output-file: hadolint-results.sarif | ||
- uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: hadolint-results.sarif | ||
category: docker-hadolint | ||
- id: hadolint | ||
uses: hadolint/[email protected] | ||
continue-on-error: true # enforce scan upload pull request | ||
with: | ||
format: tty | ||
- uses: actions/github-script@v7 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
script: | | ||
const output = ` | ||
#### Hadolint: \`${{ steps.hadolint.outcome }}\` | ||
\`\`\` | ||
${process.env.HADOLINT_RESULTS} | ||
\`\`\` | ||
`; | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: output | ||
}); |
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