-
Notifications
You must be signed in to change notification settings - Fork 1.4k
dedup: import _load_env from helpers + add dupehound CI #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": [ | ||
| "config:recommended", | ||
| ":disableDependencyDashboard", | ||
| ], | ||
| "baseBranchPatterns": ["main"], | ||
| "schedule": ["on the 2nd day of the month"], | ||
| "timezone": "America/Sao_Paulo", | ||
| "prConcurrentLimit": 10, | ||
| "prHourlyLimit": 0, | ||
| "labels": ["dependencies"], | ||
| "separateMajorMinor": false, | ||
| "minimumReleaseAge": "14 days", | ||
| "internalChecksFilter": "strict", | ||
| "commitMessagePrefix": "[RENOVATE]", | ||
| "packageRules": [ | ||
| { | ||
| "matchManagers": ["pep621"], | ||
| "groupName": "python-deps", | ||
| "commitMessagePrefix": "[RENOVATE] [PY]", | ||
| "matchUpdateTypes": ["minor", "patch"] | ||
| }, | ||
| { | ||
| "matchManagers": ["pep621"], | ||
| "matchUpdateTypes": ["major"], | ||
| "groupName": "python-major", | ||
| "commitMessagePrefix": "[RENOVATE] [PY] [MAJOR]", | ||
| "automerge": false | ||
| }, | ||
| { | ||
| "matchManagers": ["github-actions"], | ||
| "groupName": "github-actions", | ||
| "commitMessagePrefix": "[RENOVATE] [CI]", | ||
| "pinDigests": true | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: dupehound | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'src/**' | ||
| - 'tests/**' | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'src/**' | ||
| - 'tests/**' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Block new duplicates | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| continue-on-error: true | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install dupehound | ||
| run: | | ||
| curl -sL https://github.com/Rafaelpta/dupehound/releases/latest/download/dupehound-x86_64-unknown-linux-gnu.tar.gz | tar xz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Unpinned dupehound binary download without integrity verification introduces supply-chain and reproducibility risk Prompt for AI agents |
||
| sudo mv dupehound /usr/local/bin/ | ||
| - name: Block new duplicates vs base | ||
| env: | ||
| PR_BASE: ${{ github.event.pull_request.base.ref }} | ||
| run: | | ||
| if [ -n "$PR_BASE" ]; then | ||
| dupehound check --diff "origin/$PR_BASE" . | ||
| else | ||
| dupehound check --diff HEAD~1 . | ||
| fi | ||
|
|
||
| scan: | ||
| name: Repo slop score | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| - name: Install dupehound | ||
| run: | | ||
| curl -sL https://github.com/Rafaelpta/dupehound/releases/latest/download/dupehound-x86_64-unknown-linux-gnu.tar.gz | tar xz | ||
| sudo mv dupehound /usr/local/bin/ | ||
| - name: Scan | ||
| run: | | ||
| dupehound scan . | tee /tmp/dh-scan.txt | ||
| SCORE=$(grep -oE 'SLOP SCORE[[:space:]]+[0-9.]+%' /tmp/dh-scan.txt | head -1 | grep -oE '[0-9.]+%' || echo "n/a") | ||
| echo "## dupehound slop score" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "**${SCORE}**" >> "$GITHUB_STEP_SUMMARY" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: Renovate | ||
| on: | ||
| schedule: | ||
| - cron: '0 5 2 * *' # Monthly: 2nd at 05:00 UTC (02:00 BRT) | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| renovate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Self-hosted Renovate | ||
| uses: renovatebot/github-action@v41 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Third-party GitHub Action Prompt for AI agents |
||
| with: | ||
| configurationFile: .github/renovate.json5 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked Useful? React with 👍 / 👎. |
||
| env: | ||
| LOG_LEVEL: info | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub's workflow syntax says job-level
continue-on-error: trueprevents a workflow run from failing when that job fails. Since this is set on the only job that runsdupehound check, a PR that introduces duplicates will still get a passing workflow instead of being blocked by the “Block new duplicates” check; drop this flag if the gate is meant to enforce the check.Useful? React with 👍 / 👎.