Skip to content

Commit

Permalink
ci: add gitleaks, modularize detect-duplicate-actions (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
elijaholmos authored Sep 22, 2022
1 parent 4f6e429 commit 2ce0a22
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 13 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/detect-duplicate-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: detect-duplicate-actions

on:
workflow_call:
outputs:
should_skip:
description: 'Returns "true" if the current run should be skipped'
value: ${{ jobs.detect-duplicate-actions.outputs.should_skip }}

jobs:
detect-duplicate-actions:
name: detect-duplicate-actions
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Detect Duplicate
id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
cancel_others: 'true'
concurrent_skipping: 'same_content'
23 changes: 23 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Code Scan
on:
push:
branches: [dev]
pull_request:
workflow_dispatch:

jobs:
detect-duplicate-actions:
uses: ./.github/workflows/detect-duplicate-actions.yml
gitleaks:
name: gitleaks
needs: detect-duplicate-actions
if: ${{ needs.detect-duplicate-actions.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_NOTIFY_USER_LIST: '@elijaholmos'
14 changes: 1 addition & 13 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@ on:

jobs:
detect-duplicate-actions:
name: detect-duplicate-actions
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Detect Duplicate
id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
cancel_others: 'true'
concurrent_skipping: 'same_content'
uses: ./.github/workflows/detect-duplicate-actions.yml
check-license-headers:
name: check-license-headers
needs: detect-duplicate-actions
Expand Down

0 comments on commit 2ce0a22

Please sign in to comment.