Skip to content

Commit da71c86

Browse files
authored
Merge branch 'main' into dependabot/pip/main/cyclonedx-python-lib-5.0.1
2 parents 50a466a + 3956103 commit da71c86

18 files changed

Lines changed: 158 additions & 52 deletions

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM mcr.microsoft.com/devcontainers/python:1-3.12-bullseye
44
# pv is required for asciicasts
55
RUN apt-get update && apt-get install --no-install-recommends -y \
66
pv=1.6.6-1+b1 \
7-
subversion=1.14.1-3+deb11u1 && \
7+
subversion=1.14.1-3+deb11u2 && \
88
rm -rf /var/lib/apt/lists/*
99

1010
WORKDIR /workspaces/dfetch
@@ -20,7 +20,7 @@ ENV PYTHONUSERBASE="/home/dev/.local"
2020

2121
COPY --chown=dev:dev . .
2222

23-
RUN pip install --no-cache-dir --root-user-action=ignore --upgrade pip==25.0.1 \
23+
RUN pip install --no-cache-dir --root-user-action=ignore --upgrade pip==25.1.1 \
2424
&& pip install --no-cache-dir --root-user-action=ignore -e .[development,docs,test,casts] \
2525
&& pre-commit install --install-hooks
2626

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Checkout repository
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@v5
4040

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL

.github/workflows/devcontainer.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: DevContainer
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
devcontainer:
11+
name: DevContainer Build & Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v5
17+
18+
- name: Cache Docker layers
19+
uses: actions/cache@v4
20+
with:
21+
path: /tmp/.buildx-cache
22+
key: devcontainer-${{ runner.os }}-${{ github.sha }}
23+
restore-keys: |
24+
devcontainer-${{ runner.os }}-
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Build DevContainer image
30+
uses: devcontainers/ci@v0.3
31+
with:
32+
runCmd: |
33+
echo "Installing test dependencies..."
34+
pip install -e .[development,docs,casts]
35+
36+
echo "Running pre-commit checks..."
37+
pre-commit run --all-files
38+
39+
echo "Running unit tests..."
40+
python -m pytest tests
41+
42+
echo "Building documentation..."
43+
make -C doc html
44+
make -C doc/landing-page html

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ jobs:
66
docs:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
9+
- uses: actions/checkout@v5
1010

1111
- name: Install Python
12-
uses: actions/setup-python@v5
12+
uses: actions/setup-python@v6
1313
with:
1414
python-version: '3.x'
1515

.github/workflows/landing-page.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
publish:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414

1515
- name: Setup Python
16-
uses: actions/setup-python@v5
16+
uses: actions/setup-python@v6
1717
with:
1818
python-version: "3.12"
1919

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
id-token: write
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
- name: Set up Python
24-
uses: actions/setup-python@v5
24+
uses: actions/setup-python@v6
2525
with:
2626
python-version: '3.x'
2727
- name: Install dependencies

.github/workflows/run.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: windows-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

1818
- uses: cygwin/cygwin-install-action@master
1919

@@ -30,11 +30,10 @@ jobs:
3030
- run: dfetch check
3131
- run: dfetch update
3232
- run: dfetch update
33-
- run: dfetch check --sarif sarif.json
34-
- name: Upload SARIF file
35-
uses: github/codeql-action/upload-sarif@v3
33+
- name: Dfetch SARIF Check
34+
uses: ./
3635
with:
37-
sarif_file: sarif.json
36+
working-directory: '.'
3837

3938
- name: Run example
4039
working-directory: ./example
@@ -53,10 +52,10 @@ jobs:
5352
runs-on: ${{ matrix.platform }}
5453

5554
steps:
56-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v5
5756

5857
- name: Setup Python
59-
uses: actions/setup-python@v5
58+
uses: actions/setup-python@v6
6059
with:
6160
python-version: ${{ matrix.python-version }}
6261

@@ -87,8 +86,7 @@ jobs:
8786
- run: dfetch check
8887
- run: dfetch update
8988
- run: dfetch update
90-
- run: dfetch check --sarif sarif.json
91-
- name: Upload SARIF file
92-
uses: github/codeql-action/upload-sarif@v3
89+
- name: Dfetch SARIF Check
90+
uses: ./
9391
with:
94-
sarif_file: sarif.json
92+
working-directory: '.'

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515

1616
- name: Setup Python
17-
uses: actions/setup-python@v5
17+
uses: actions/setup-python@v6
1818
with:
1919
python-version: '3.12'
2020

@@ -35,7 +35,7 @@ jobs:
3535
# - run: flake8 dfetch # Checks pep8 conformance
3636
- run: pylint dfetch # Checks pep8 conformance
3737
- run: ruff check dfetch # Check using ruff
38-
- run: mypy --strict dfetch # Check types
38+
- run: mypy dfetch # Check types
3939
- run: pyright . # Check types
4040
- run: doc8 doc # Checks documentation
4141
- run: pydocstyle dfetch # Checks doc strings

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@v5
24+
- name: Setup Python
25+
uses: actions/setup-python@v6
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

0 commit comments

Comments
 (0)