Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e4f9c65
ci: det-21 init architecture of ci to add comment to pr
Rayan-ouer Jul 11, 2026
c5ca409
ci: det-21 change shell nu -> sh
Rayan-ouer Jul 11, 2026
d81e5da
feat: det-21 change import to action.js
Rayan-ouer Jul 11, 2026
602095e
feat: det-21 execute command in a child processs
Rayan-ouer Jul 12, 2026
2019a9f
feat: det-21 test first version of CI and call API of github
Rayan-ouer Jul 21, 2026
b855680
fix: det-21 move index.js out src directory
Rayan-ouer Jul 21, 2026
1cd6d8c
fix: det-21 install dependecies
Rayan-ouer Jul 21, 2026
6240542
refactor: det-21 specify working directory
Rayan-ouer Jul 21, 2026
c4ecc3d
refactor: det-21 update packagejson
Rayan-ouer Jul 21, 2026
62541ff
fix: det-21 name of execCommand function
Rayan-ouer Jul 21, 2026
9f7964f
fix: det-21 seralise instead of debug in test object
Rayan-ouer Jul 21, 2026
8bbd2ec
refactor: det-21 change trigger event push -> pull_request
Rayan-ouer Jul 21, 2026
00e0794
refactor: det-21 specify branch
Rayan-ouer Jul 21, 2026
0085c0f
test: det-21 test to trigger ci on push event*
Rayan-ouer Jul 21, 2026
77af5e5
ci: det-21 trigger ci on pr
Rayan-ouer Jul 21, 2026
dac4ac9
test: det-21 test to trigger ci
Rayan-ouer Jul 21, 2026
1462e35
Merge branch 'main' into rayanouerdane/det-21-ci-that-automatically-a…
Rayan-ouer Jul 21, 2026
97651f1
ci: det-21 just to test
Rayan-ouer Jul 21, 2026
3b3d253
Merge branch 'rayanouerdane/det-21-ci-that-automatically-adds-comment…
Rayan-ouer Jul 21, 2026
72c974d
test(app): det-21 debug run import
Rayan-ouer Jul 21, 2026
1b79c36
refactor: det-21 come back to 9f7964ff65ee commit
Rayan-ouer Jul 25, 2026
abba2d4
fix: conflict
Rayan-ouer Jul 25, 2026
504476b
ci(app): det-21 put back main branch in ci
Rayan-ouer Jul 25, 2026
453de6c
ci: det-21 add function run
Rayan-ouer Jul 26, 2026
8cc94f0
refactor: det-21 export execCommand
Rayan-ouer Jul 26, 2026
8f8cde1
ci: det-21 delete debtlint and move logic in index.js
Rayan-ouer Jul 26, 2026
cdc9448
refactor: det-21 remove catch to see erros
Rayan-ouer Jul 26, 2026
762876b
refactor: det-21 get github tokens from env
Rayan-ouer Jul 26, 2026
36e8a1f
fix: det-21 add forgotten import
Rayan-ouer Jul 26, 2026
fd253fe
refactor: det-21 use octokit request directlyù
Rayan-ouer Jul 26, 2026
6f967b4
refactor: det-21 test for loop in js
Rayan-ouer Jul 26, 2026
c816c65
feat: det-21 post for every element in the rang loop
Rayan-ouer Jul 26, 2026
6854720
fix: det-21 specify header in post request
Rayan-ouer Jul 26, 2026
5038e67
fix: det-21 remove optional on codeDescritption
Rayan-ouer Jul 26, 2026
1696c15
refactor: det-21 rename code descripton to match with struct rust
Rayan-ouer Jul 26, 2026
ea22ebe
refactor: det-21 create comment for each range of code
Rayan-ouer Jul 27, 2026
f6c54b4
refactor: det-21 put code abode severity
Rayan-ouer Jul 27, 2026
4906cf4
test: det-21 try with a file in the git diff
Rayan-ouer Jul 27, 2026
c2a5538
refactor: det-21 format code with rustfmt
Rayan-ouer Aug 3, 2026
be1394b
refactor: det-21 rename linter mod, and format with clippy
Rayan-ouer Aug 3, 2026
aad8ef1
fix: det-21 fix test path
Rayan-ouer Aug 3, 2026
8b4ef03
refactor: det-21 try to create an issue comment to avoid git diff pro…
Rayan-ouer Aug 3, 2026
c0dd1d2
refactor: det-21 try to add markdown code to comment
Rayan-ouer Aug 3, 2026
0097419
fix: det-21 add an + after the backstick
Rayan-ouer Aug 3, 2026
17b912b
fix: det-21 use slash instead of +
Rayan-ouer Aug 3, 2026
d95e4d2
feat: det-21 handle return of debtlint like an list of object
Rayan-ouer Aug 7, 2026
326577a
refactor: det-21 rewrite project in typescript, and start architecture
Rayan-ouer Aug 7, 2026
f66cce9
fix: format with rustfmt
Rayan-ouer Aug 7, 2026
87295c9
refactor: det-21 use nushell to cross plateform action and use tsx
Rayan-ouer Aug 7, 2026
254c0b8
fix: det-21 fix index.ts by main.ts
Rayan-ouer Aug 7, 2026
b9d7a48
fix: det-21 specify action directory in action.yml
Rayan-ouer Aug 8, 2026
7b2cc85
test: det-21 call only linter in main(to test)
Rayan-ouer Aug 8, 2026
e097390
refactor: det-21 remove comment on api call
Rayan-ouer Aug 8, 2026
abebdd8
refactor(app): det-21 move code description and add imbrecated loop
Rayan-ouer Aug 8, 2026
4fee625
feat: det-21 use Act to test action without github minutes
Rayan-ouer Aug 11, 2026
0e22ca2
feat: save act configuration and functional CI
Rayan-ouer Aug 11, 2026
1101279
Merge pull request #41 from PoCInnovation/rayanouerdane/act-configura…
Rayan-ouer Aug 11, 2026
17548d4
refactor: det-21 remove act configuration to this branch
Rayan-ouer Aug 11, 2026
19823f7
refactor: det-21 uncomment main
Rayan-ouer Aug 11, 2026
ee0d7aa
refactor: det-21 format with rustfmt
Rayan-ouer Aug 11, 2026
a646fd8
refactor: det-21 replave env.GITHUB_TOKEN by native token runner vari…
Rayan-ouer Aug 11, 2026
73d3b32
feat: det-21 handle new inputs in jobs file
Rayan-ouer Aug 24, 2026
9f9da50
feat: det-21 add generic function to handle argument properly in ci
Rayan-ouer Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/debtlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check duplication

on:
pull_request:
branches: [ "main" ]

jobs:
debtlint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Run debtlint
uses: ./action
with:
vocab-path: fixtures/sample.vocab.json
extensions: 'rs, py'
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

# Act
.secrets
.env

# Added by cargo

/target
/target
63 changes: 37 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions action/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
10 changes: 10 additions & 0 deletions action/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Debtlint action

This action download and run the [debtlint tools](https://github.com/PoCInnovation/Debtlint).


## Inputs

**Required**

## Outputs
42 changes: 42 additions & 0 deletions action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: debtlint
description: Identifies repeated or near-duplicate code segments across a codebase.
author: poc-innovation
branding:
icon: "check-circle"
color: "green"

inputs:
config-path:
description: "Debtlint configuration file."
required: false

vocab-path:
description: "Debtlint vocabulary. If speficied Debtlint will run with the ```--load-vocab``` flag."
required: false

extensions:
description: "The file extensions to run Debtlint against. This is a comma-separated string."
required: false

runs:
using: composite
steps:
- name: Setup nu shell
uses: hustcer/setup-nu@v3
with:
version: 0.114.1

- name: Install debtlint
shell: nu {0}
run: cargo install debtlint

- name: Install dependencies
shell: nu {0}
working-directory: ${{ github.action_path }}
run: npm install

- name: Run debtlint
shell: nu {0}
env:
GITHUB_TOKEN: ${{ github.token }}
run: npx tsx --tsconfig action/tsconfig.json ${{ github.action_path }}/main.ts
25 changes: 25 additions & 0 deletions action/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { z } from "zod";
import { Diagnostic, diagnosticSchema } from '@/typings/diagnostic';

import { getOctokit, context } from '@actions/github';
import { getInput } from "@actions/core";

import { addOption } from "@/utils/flags";
import { execCommand } from "@/utils/executor"
import { parsePullRequestContext } from "@/utils/convert"
import { createPullRequestComments } from "@/api/routes";

async function run() {
const GITHUB_TOKEN: string = process.env.GITHUB_TOKEN!;
const octokit = getOctokit(GITHUB_TOKEN);
const eventContext = parsePullRequestContext(context)

const args: string[] = [];
addOption(args, "--load-vocab", getInput("config-path"));

const rawOutput = await execCommand('cargo', ['run', 'main.rs'].concat(args));
const diagnostics: Diagnostic[] = z.array(diagnosticSchema).parse(JSON.parse(rawOutput));
await createPullRequestComments(octokit, diagnostics, eventContext)
}

run()
Loading