Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 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
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
17 changes: 17 additions & 0 deletions .github/workflows/debtlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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:
files: "src"
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
31 changes: 31 additions & 0 deletions action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: debtlint
description: Identifies repeated or near-duplicate code segments across a codebase.
author: poc-innovation
branding:
icon: "check-circle"
color: "green"

inputs:
files:
description: "File passed to the program."
required: false

runs:
using: composite
steps:

- name: Install debtlint
shell: sh
run: cargo install debtlint

- name: Install dependencies
shell: sh
run: npm install
working-directory: ./action


- name: Run debtlint
shell: sh
env:
GITHUB_TOKEN: ${{ github.token }}
run: node ${{ github.action_path }}/index.js
20 changes: 20 additions & 0 deletions action/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import { Octokit } from '@octokit/action';

import { execCommand } from "./src/executor.js"
import { createComment } from "./src/api.js";
import { diagnosticSchema } from './src/schemas.js';

async function run() {
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
const octokit = github.getOctokit(GITHUB_TOKEN);
const { context = {} } = github;
const rawOutput = await execCommand('cargo', ['run', 'main.rs']);

console.log(rawOutput)
const diagnostic = diagnosticSchema.parse(JSON.parse(rawOutput));
await createComment(octokit, diagnostic, context)
}

run()
Loading
Loading