Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Update CI to tidy itself and use DeepSource (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmahsax authored Jun 14, 2023
1 parent 2529a4d commit 355a2f1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 89 deletions.
3 changes: 3 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version = 1

[[analyzers]]
name = "ruby"

[[analyzers]]
name = "secrets"
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Build
name: "Auto/Trigger: Build & Push"

on:
push:
branches: [ main ]
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io

jobs:
docker-build:
Expand All @@ -18,9 +19,9 @@ jobs:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v4
id: meta
with:
Expand All @@ -29,5 +30,5 @@ jobs:
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.TAGS }}
labels: ${{ steps.meta.outputs.LABELS }}
17 changes: 17 additions & 0 deletions .github/workflows/delete_old_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Daily/Trigger: Delete Old Packages"

on:
schedule:
- cron: "0 5 * * *" # 5am UTC daily (11pm/12am CT)
workflow_dispatch:

jobs:
delete-old-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/delete-package-versions@v4
with:
delete-only-untagged-versions: 'true'
min-versions-to-keep: 5
package-name: ${{ github.event.repository.name }}
package-type: container
8 changes: 0 additions & 8 deletions .github/workflows/gitleaks.toml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/scheduled.yml

This file was deleted.

53 changes: 6 additions & 47 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,24 @@
name: Test
name: "Auto: Test"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
GITLEAKS_VERSION: v8.15.1
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [2.6, 2.7, 3.0, 3.1, 3.2]
RUBY: [ 2.6, 2.7, 3.0, 3.1, 3.2 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
ruby-version: ${{ matrix.RUBY }}
- run: bundle exec rake
pronto:
if: github.EVENT_NAME == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: HeRoMo/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
gitleaks:
if: github.EVENT_NAME == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
curl -H "Accept: application/vnd.github.v3.raw" \
-L "https://api.github.com/repos/zricethezav/gitleaks/contents/config/gitleaks.toml?ref=${{ env.GITLEAKS_VERSION }}" \
>> ${{ github.WORKSPACE }}/.github/workflows/original.toml
sed "/\[allowlist\]/,/^$/d" ${{ github.WORKSPACE }}/.github/workflows/original.toml >> ${{ github.WORKSPACE }}/.github/workflows/official.toml
cat .github/workflows/gitleaks.toml >> .github/workflows/official.toml
if [[ ${{ github.REF }} == 'refs/heads/main' ]]; then
CURRENT_COMMIT="${{ github.SHA }}"
else
CURRENT_COMMIT="${{ github.EVENT.PULL_REQUEST.HEAD.SHA }}"
fi
echo "LOG_OPTS='^origin/main $CURRENT_COMMIT'" >> $GITHUB_ENV
- uses: addnab/docker-run-action@v3
with:
image: zricethezav/gitleaks:${{ env.GITLEAKS_VERSION }}
options: -v ${{ github.WORKSPACE }}:/app
run: |
cd /app
git config --global --add safe.directory /app
gitleaks detect --verbose --source='./' \
--config='.github/workflows/official.toml' \
--log-opts=${{ env.LOG_OPTS }}

0 comments on commit 355a2f1

Please sign in to comment.