Skip to content

Commit 6917e7d

Browse files
committed
Move action to root and document it in README
1 parent 2fcce1d commit 6917e7d

5 files changed

Lines changed: 58 additions & 71 deletions

File tree

.github/actions/dfetch-action/action.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/run.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- run: dfetch update
3232
- run: dfetch update
3333
- name: Dfetch SARIF Check
34-
uses: ./.github/actions/dfetch-action
34+
uses: .
3535
with:
3636
working-directory: '.'
3737

@@ -87,7 +87,7 @@ jobs:
8787
- run: dfetch update
8888
- run: dfetch update
8989
- name: Dfetch SARIF Check
90-
uses: ./.github/actions/dfetch-action
90+
uses: .
9191
with:
9292
working-directory: '.'
9393

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,29 @@ See [alternatives](https://dfetch.readthedocs.io/en/latest/alternatives.html) fo
3737
## Install
3838

3939
### Stable
40+
4041
```bash
4142
pip install dfetch
4243
```
4344

4445
### latest version
46+
4547
```bash
4648
pip install https://github.com/dfetch-org/dfetch/archive/main.zip
4749
```
50+
51+
## Github Action
52+
53+
You can use DFetch in your Github Actions workflow to check your dependencies.
54+
The results will be uploaded to Github. Add the following to your workflow file:
55+
56+
```yaml
57+
jobs:
58+
dfetch-check:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Run Dfetch Check
62+
uses: dfetch-org/dfetch@main
63+
with:
64+
working-directory: '.' # optional, defaults to project root
65+
```

action.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Dfetch Check'
2+
description: 'Run dfetch check and upload SARIF results.'
3+
author: 'dfetch-org'
4+
branding:
5+
icon: 'check-circle'
6+
color: 'blue'
7+
8+
inputs:
9+
working-directory:
10+
description: 'Directory to run dfetch in (default: project root)'
11+
required: false
12+
default: '.'
13+
14+
outputs:
15+
sarif-path:
16+
description: 'Path to the generated SARIF file.'
17+
value: sarif.json
18+
19+
runs:
20+
using: 'composite'
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.13'
28+
- name: Install dfetch
29+
run: pip install .
30+
shell: bash
31+
- name: Run dfetch check (SARIF)
32+
run: dfetch check --sarif sarif.json
33+
shell: bash
34+
working-directory: ${{ inputs.working-directory }}
35+
- name: Upload SARIF file
36+
uses: github/codeql-action/upload-sarif@v3
37+
with:
38+
sarif_file: sarif.json

doc/dfetch-action.md

Whitespace-only changes.

0 commit comments

Comments
 (0)