Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .github/workflows/debtlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check duplication

on:
push:

jobs:
debtlint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Run debtlint
uses: ./action
with:
files: "src"
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
24 changes: 24 additions & 0 deletions action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: debtlint
description: Identifies repeated or near-duplicate code segments across a codebase.
author: poc-innovation
branding:
icon: "check-circle"
color: "green"

inputs:
files:
required: false

runs:
using: composite
steps:

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

- name: Run debtlint
shell: sh
env:
GITHUB_TOKEN: ${{ github.token }}
run: node ${{ github.action_path }}/index.js
274 changes: 274 additions & 0 deletions action/package-lock.json

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

20 changes: 20 additions & 0 deletions action/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "action",
"version": "1.0.0",
"description": "This action download and run the [debtlint tools](https://github.com/PoCInnovation/Debtlint).",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "module",
"dependencies": {
"@actions/core": "^3.0.1",
"@actions/github": "^9.1.1"
},
"devDependencies": {
"@types/node": "^26.1.1"
}
}
15 changes: 15 additions & 0 deletions action/src/debtlint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ChildProcess, spawn } from 'child_process';


/**
* Execute a command asynchronously.
* @param {string} cmd
* @param {array} arguments
*/
export const execCommand = (cmd, arg = []) => {
return spawn(cmd, arg)
};

// convert object to json
// parse list of duplicate element
// send element with the api github
Empty file added action/src/index.js
Empty file.
Loading