Skip to content

Commit

Permalink
Merge pull request #2 from cyber-dojo/add-pull-request-to-kosli-sdlc-…
Browse files Browse the repository at this point in the history
…gate

Add pull-request to Kosli sdlc gate in CI pipeline
  • Loading branch information
JonJagger authored Mar 3, 2024
2 parents 0951a28 + 5379fbd commit 09e7b47
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 42 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,26 @@ jobs:
echo "image_name=cyberdojo/runner:${IMAGE_TAG}" >> ${GITHUB_OUTPUT}
# pull-request:
# needs: [kosli-trail]
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: write
# pull-requests: read
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup Kosli CLI
# uses: kosli-dev/setup-cli-action@v2
# with:
# version: ${{ vars.KOSLI_CLI_VERSION }}
#
# - name: Attest pull-request evidence to Kosli Trail
# run:
# kosli attest pullrequest github
# --github-token=${{ secrets.GITHUB_TOKEN }}
# --name=runner.pull-request
pull-request:
needs: [kosli-trail]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4

- name: Setup Kosli CLI
uses: kosli-dev/setup-cli-action@v2
with:
version: ${{ vars.KOSLI_CLI_VERSION }}

- name: Attest pull-request evidence to Kosli Trail
run:
kosli attest pullrequest github
--github-token=${{ secrets.GITHUB_TOKEN }}
--name=runner.pull-request


lint:
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:
sdlc-control-gate:
needs: [lint, unit-tests, integration-tests, snyk-container-scan, snyk-code-scan, kosli-trail, build-image]
needs: [pull-request, lint, unit-tests, integration-tests, snyk-container-scan, snyk-code-scan, kosli-trail, build-image]
runs-on: ubuntu-latest
steps:
- name: Setup Kosli CLI
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/main_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@ jobs:
echo "image_name=cyberdojo/runner:${IMAGE_TAG}" >> ${GITHUB_OUTPUT}
# pull-request:
# needs: [kosli-trail]
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: write
# pull-requests: read
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup Kosli CLI
# uses: kosli-dev/setup-cli-action@v2
# with:
# version: ${{ vars.KOSLI_CLI_VERSION }}
#
# - name: Report pull-request evidence to Kosli Trail
# run:
# kosli attest pullrequest github
# --github-token=${{ secrets.GITHUB_TOKEN }}
# --name=runner.pull-request
pull-request:
needs: [kosli-trail]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4

- name: Setup Kosli CLI
uses: kosli-dev/setup-cli-action@v2
with:
version: ${{ vars.KOSLI_CLI_VERSION }}

- name: Report pull-request evidence to Kosli Trail
run:
kosli attest pullrequest github
--github-token=${{ secrets.GITHUB_TOKEN }}
--name=runner.pull-request


lint:
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
sdlc-control-gate:
needs: [lint, unit-tests, integration-tests, snyk-container-scan, snyk-code-scan, kosli-trail, wait-for-image]
needs: [pull-request, lint, unit-tests, integration-tests, snyk-container-scan, snyk-code-scan, kosli-trail, wait-for-image]
runs-on: ubuntu-latest
steps:
- name: Setup Kosli CLI
Expand Down
2 changes: 2 additions & 0 deletions .kosli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ trail:
artifacts:
- name: runner
attestations:
- name: pull-request
type: pull_request
- name: lint
type: generic
- name: unit-test
Expand Down

0 comments on commit 09e7b47

Please sign in to comment.