You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A GitHub Action that runs security checks against dependency typosquatting attacks using [Twyn](https://github.com/elementsinteractive/twyn).
4
+
5
+
## What is Twyn?
6
+
7
+
Twyn is a security tool that analyzes your project dependencies to detect potential typosquatting attacks - when malicious packages have names similar to legitimate ones to trick developers into installing them.
8
+
9
+
## Examples
10
+
11
+
### Basic Security Check
12
+
13
+
```yaml
14
+
- name: Run Twyn Security Check
15
+
uses: elementsinteractive/twyn-action@v1
16
+
```
17
+
18
+
### With Table Output and PR Comments
19
+
20
+
```yaml
21
+
- name: Run Twyn Security Check
22
+
uses: elementsinteractive/twyn-action@v1
23
+
with:
24
+
table: true
25
+
version: v6
26
+
publish: true
27
+
github-token: ${{ secrets.GITHUB_TOKEN }}
28
+
```
29
+
30
+
### Analyze Specific Files
31
+
32
+
```yaml
33
+
- name: Run Twyn Security Check
34
+
uses: elementsinteractive/twyn-action@v1
35
+
with:
36
+
dependency-file: "requirements.txt,package.json"
37
+
table: true
38
+
recursive: true
39
+
```
40
+
41
+
42
+
## Inputs
43
+
44
+
| Input | Description | Required | Default |
45
+
|-------|-------------|----------|---------|
46
+
| `dependency-file` | Dependency file(s) to analyze (comma-separated) | No | Auto-detect |
47
+
| `table` | Display results in table format (requires version >=v6) | No | `false` |
48
+
| `json` | Display results in JSON format | No | `false` |
49
+
| `publish` | Publish results as PR comments | No | `false` |
50
+
| `github-token` | GitHub token for publishing comments | No | - |
51
+
| `recursive` | Recursively search for dependency files | No | `false` |
52
+
| `selector-method` | Method for selecting typosquats (`first-letter`, `nearby-letter`, `all`) | No | - |
53
+
| `v` | Enable verbose output | No | `false` |
54
+
| `vv` | Enable extra verbose output | No | `false` |
55
+
| `version` | Twyn version to use | No | `latest` |
| `has-findings` | Boolean indicating if issues were found |
64
+
65
+
## Publishing Results to PR
66
+
67
+
When `publish: true` is enabled, the action will automatically post a comment to the Pull Request with a formatted table showing any security findings. This requires:
68
+
- `table: true` (automatically enabled when publish is true)
69
+
- `version: "v6"` or higher (table format requires Twyn v6+)
70
+
- `github-token` to be provided
71
+
- The workflow to run on a Pull Request event
72
+
73
+
The PR comment will include a detailed table with information about potential typosquatting packages found.
0 commit comments