Skip to content

Commit

Permalink
Merge pull request #8 from instriq/develop
Browse files Browse the repository at this point in the history
New deploy workflow
  • Loading branch information
htrgouvea authored Aug 23, 2024
2 parents 6f5ea99 + bceb404 commit bef0260
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build Docker image
id: build
run: |
docker build --file Dockerfile --tag ${{ github.repository }}:latest .
docker tag ${{ github.repository }}:latest docker.pkg.github.com/${{ github.repository }}/security-gate:latest
COMMIT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
docker build --file Dockerfile --tag ${{ github.repository }}:latest --tag ${{ github.repository }}:${COMMIT_SHA} .
echo "COMMIT_SHA=${COMMIT_SHA}" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: docker.pkg.github.com
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.LESIS_DEPLOY }}

- name: Push Docker image to GitHub Container Registry
run: docker push docker.pkg.github.com/${{ github.repository }}/security-gate:latest
run: |
docker push ghcr.io/${{ github.repository }}/security-gate:latest
docker push ghcr.io/${{ github.repository }}/security-gate:${{ env.COMMIT_SHA }}
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docker Image CI

on:
push:
branches: [ "master", "develop" ]
branches: [ "main", "develop" ]
pull_request:
branches: [ "master", "develop" ]
branches: [ "main", "develop" ]

jobs:

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ jobs:
--critical $MAX_CRITICAL \
--high $MAX_HIGH \
--medium $MAX_MEDIUM \
--low $MAX_LOW
--low $MAX_LOW \
--dependency-alerts \
--code-alerts \
--secret-alerts
```
---
Expand Down Expand Up @@ -89,9 +92,9 @@ Core Commands
-h, --high High severity limit
-m, --medium Medium severity limit
-l, --low Low severity limit
--dependency-alerts Check for dependency alerts
--secret-alerts Check for secret scanning alerts
--code-alerts Check for code scanning alerts
--dependency-alerts Check dependency alerts
--secret-alerts Check secret scanning alerts
--code-alerts Check code scanning alerts
```

---
Expand All @@ -100,7 +103,7 @@ Core Commands

```
$ docker build -t security-gate .
$ docker run -ti --rm security-gate -t <GITHUB_TOKEN> -r <organization/repository> --critical 1 --high 2 --medium 3 --low 5
$ docker run -ti --rm security-gate -t <GITHUB_TOKEN> -r <organization/repository> --critical 1 --high 2 --medium 3 --low 5 --dependency-alerts --code-alerts --secret-alerts
```

---
Expand Down
6 changes: 3 additions & 3 deletions lib/SecurityGate/Utils/Helper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ package SecurityGate::Utils::Helper {
\r\t-h, --high High severity limit
\r\t-m, --medium Medium severity limit
\r\t-l, --low Low severity limit
\r\t--dependency-alerts Check for dependency alerts
\r\t--secret-alerts Check for secret scanning alerts
\r\t--code-alerts Check for code scanning alerts\n\n";
\r\t--dependency-alerts Check dependency alerts
\r\t--secret-alerts Check secret scanning alerts
\r\t--code-alerts Check code scanning alerts\n\n";
}
}

Expand Down

0 comments on commit bef0260

Please sign in to comment.