-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(ci): move to using stand alone ci examples (#1371)
- Loading branch information
Showing
24 changed files
with
364 additions
and
427 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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
bearer: | ||
machine: | ||
image: ubuntu-2204:2023.07.2 | ||
environment: | ||
# Set to default branch of your repo | ||
DEFAULT_BRANCH: main | ||
steps: | ||
- checkout | ||
- run: curl -sfL https://raw.githubusercontent.com/Bearer/bearer/main/contrib/install.sh | sh -s -- -b /tmp | ||
- run: CURRENT_BRANCH=$CIRCLE_BRANCH SHA=$CIRCLE_SHA1 /tmp/bearer scan . | ||
|
||
workflows: | ||
test: | ||
jobs: | ||
- bearer |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
bearer: | ||
machine: | ||
image: ubuntu-2204:2023.07.2 | ||
environment: | ||
# Set to default branch of your repo | ||
DEFAULT_BRANCH: main | ||
steps: | ||
- checkout | ||
- run: curl -sfL https://raw.githubusercontent.com/Bearer/bearer/main/contrib/install.sh | sh -s -- -b /tmp | ||
- run: curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /tmp | ||
- run: | | ||
CURRENT_BRANCH=$CIRCLE_BRANCH SHA=$CIRCLE_SHA1 /tmp/bearer scan . --format=rdjson --output=rd.json || export BEARER_EXIT=$? | ||
cat rd.json | REVIEWDOG_GITHUB_API_TOKEN=$GITHUB_TOKEN /tmp/reviewdog -f=rdjson -reporter=github-pr-review | ||
exit $BEARER_EXIT | ||
workflows: | ||
test: | ||
jobs: | ||
- bearer: | ||
filters: | ||
branches: | ||
# No need to run a check on default branch | ||
ignore: main | ||
context: | ||
- bearer | ||
# make sure to set GITHUB_TOKEN in your context |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Bearer | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
rule_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bearer | ||
uses: bearer/bearer-action@v2 | ||
with: | ||
config-file: '/some/path/bearer.yml' | ||
only-rule: 'ruby_lang_cookies,ruby_lang_http_post_insecure_with_data' | ||
skip-path: 'users/*.go,users/admin.sql' |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Bearer | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
rule_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bearer | ||
uses: bearer/bearer-action@v2 |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Bearer | ||
on: | ||
push: | ||
branches: | ||
- main | ||
permissions: | ||
contents: read | ||
jobs: | ||
rule_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run Report | ||
id: report | ||
uses: bearer/bearer-action@v2 | ||
with: | ||
api-key: ${{ secrets.BEARER_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Bearer Defect Dojo | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
rule_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run Report | ||
id: report | ||
uses: bearer/bearer-action@v2 | ||
with: | ||
format: gitlab-sast | ||
output: gl-sast-report.json | ||
- name: Defect Dojo | ||
if: always() | ||
env: | ||
DD_TOKEN: ${{ secrets.DD_TOKEN}} | ||
DD_APP: ${{ secrets.DD_APP}} | ||
DD_ENGAGEMENT: ${{ secrets.DD_ENGAGEMENT}} | ||
run: | | ||
curl -X POST -F "[email protected]" -F "product_name=$DD_APP" -F "engagement_name=$DD_ENGAGEMENT" -F "scan_type=GitLab SAST Report" -H "Authorization: Token $DD_TOKEN" http://example.com/api/v2/import-scan/ |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Bearer PR Check | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
rule_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: reviewdog/action-setup@v1 | ||
with: | ||
reviewdog_version: latest | ||
- name: Bearer | ||
uses: bearer/bearer-action@v2 | ||
with: | ||
format: rdjson | ||
output: rd.json | ||
diff: true | ||
- name: Run reviewdog | ||
if: always() | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
cat rd.json | reviewdog -f=rdjson -reporter=github-pr-review |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Bearer PR Check | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
rule_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bearer | ||
uses: bearer/bearer-action@v2 | ||
with: | ||
diff: true |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Bearer | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
rule_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bearer | ||
uses: bearer/bearer-action@v2 | ||
with: | ||
format: sarif | ||
output: results.sarif | ||
- name: Upload SARIF file | ||
if: always() | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: results.sarif |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bearer: | ||
image: | ||
name: bearer/bearer | ||
entrypoint: [ "" ] | ||
script: bearer scan . |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bearer: | ||
image: | ||
name: bearer/bearer | ||
entrypoint: [ "" ] | ||
script: bearer scan . --api-key=$BEARER_TOKEN |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
bearer_mr: | ||
variables: | ||
DIFF_BASE_BRANCH: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME | ||
DIFF_BASE_COMMIT: $CI_MERGE_REQUEST_DIFF_BASE_SHA | ||
script: | ||
- curl -sfL https://raw.githubusercontent.com/Bearer/bearer/main/contrib/install.sh | sh -s -- -b /usr/local/bin | ||
- curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin | ||
- bearer scan . --format=rdjson --output=rd.json || export BEARER_EXIT=$? | ||
- cat rd.json | reviewdog -f=rdjson -reporter=gitlab-mr-discussion | ||
- exit $BEARER_EXIT |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
bearer_mr: | ||
image: | ||
name: bearer/bearer | ||
entrypoint: [ "" ] | ||
variables: | ||
DIFF_BASE_BRANCH: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME | ||
DIFF_BASE_COMMIT: $CI_MERGE_REQUEST_DIFF_BASE_SHA | ||
script: bearer scan . |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
bearer: | ||
image: | ||
name: bearer/bearer | ||
entrypoint: [ "" ] | ||
script: | ||
- bearer scan . --format gitlab-sast --output gl-sast-report.json | ||
artifacts: | ||
reports: | ||
sast: gl-sast-report.json |
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
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
Oops, something went wrong.