Skip to content

Commit

Permalink
Merge pull request #5 from GitGuardian/jeremyds/2/review-from-circlec…
Browse files Browse the repository at this point in the history
…i-team-3

feat(orb): take in account comment from CircleCI Partner Engineering …
  • Loading branch information
jeremyds authored Mar 28, 2022
2 parents 7188d28 + 4bbe11d commit 98947e3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ workflows:
jobs:
- ggshield/scan:
name: ggshield-scan # best practice is to name each orb job
base_revision: << pipeline.git.base_revision >>
base_revision: <<pipeline.git.base_revision>>
revision: <<pipeline.git.revision>>
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Publish to Circle CI
- name: Publish to CircleCI
run: |
circleci orb publish src/@orb.yml gitguardian/ggshield@${GITHUB_REF#refs/*/} --token=${{ secrets.CIRCLE_CI_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

---

# [GitGuardian Shield](https://github.com/GitGuardian/gg-shield) Circle CI Orb
# [GitGuardian Shield](https://github.com/GitGuardian/gg-shield) CircleCI Orb

[![Circle CI Registry](https://img.shields.io/badge/CircleCI%20Registry-v1-undefined.svg?logo=circleci&logoColor=white&style=for-the-badge)](https://circleci.com/orbs/registry/orb/gitguardian/ggshield)
[![CircleCI Registry](https://img.shields.io/badge/CircleCI%20Registry-v1-undefined.svg?logo=circleci&logoColor=white&style=for-the-badge)](https://circleci.com/orbs/registry/orb/gitguardian/ggshield)
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/gitguardian/ggshield?color=1B2D55&sort=semver&style=for-the-badge&label=ggshield)](https://hub.docker.com/r/gitguardian/ggshield)
[![License](https://img.shields.io/github/license/GitGuardian/gg-shield-orb?color=%231B2D55&style=for-the-badge)](LICENSE)
![GitHub stars](https://img.shields.io/github/stars/gitguardian/gg-shield-orb?color=%231B2D55&style=for-the-badge)
Expand Down Expand Up @@ -33,7 +33,7 @@ workflows:
jobs:
- ggshield/scan:
name: ggshield-scan # best practice is to name each orb job
base_revision: << pipeline.git.base_revision >>
base_revision: <<pipeline.git.base_revision>>
revision: <<pipeline.git.revision>>
```
Expand Down
33 changes: 14 additions & 19 deletions src/@orb.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

description: >
Easily integrate GitGuardian shield into your Circle CI projects.
Easily integrate GitGuardian shield into your CircleCI projects.
Scan your commits for secrets and other policy breaks
display:
Expand All @@ -22,33 +22,28 @@ examples:
jobs:
- ggshield/scan:
name: ggshield-scan # best practice is to name each orb job
base_revision: << pipeline.git.base_revision >>
base_revision: <<pipeline.git.base_revision>>
revision: <<pipeline.git.revision>>

executors:
ggshield-executor:
docker:
- image: gitguardian/ggshield:<<parameters.version>>
parameters:
version:
type: string
default: "latest"
commands:
scan-command:
steps:
- run: ggshield scan ci

jobs:
scan:
parameters:
base_revision:
description: pipeline base_revision
description: ID of the first commit to scan. Leave empty to only scan the latest commit.
type: string
default: ""
revision:
description: pipeline revision
description: ID of the last commit to scan.
type: string
tag:
description: Pick a specific gitguardian/ggshield image variant: https://hub.docker.com/r/gitguardian/ggshield/tags
default: latest
type: string
docker:
- image: gitguardian/ggshield::<<parameters.tag>>
environment:
CIRCLE_RANGE: << parameters.base_revision >>...<<parameters.revision>>
executor: ggshield-executor
CIRCLE_RANGE: <<parameters.base_revision>>...<<parameters.revision>>
steps:
- checkout
- scan-command
- run: ggshield scan -v ci

0 comments on commit 98947e3

Please sign in to comment.