Skip to content

Commit a4b0f29

Browse files
committed
add dependabot automation
1 parent 17508b4 commit a4b0f29

File tree

4 files changed

+62
-11
lines changed

4 files changed

+62
-11
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test and Build
1+
name: Build
22

33
on:
44
push:
@@ -9,18 +9,20 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
test:
12+
build:
13+
name: Build
1314
permissions:
1415
contents: read # for actions/checkout to fetch code
1516
pull-requests: read # for SonarSource/sonarcloud-github-action to determine which PR to decorate
17+
env:
18+
POETRY_VERSION: 2.1.1
1619
strategy:
1720
# By default, GitHub will maximize the number of jobs run in parallel
1821
# depending on the available runners on GitHub-hosted virtual machines.
1922
# max-parallel: 8
2023
fail-fast: false
2124
matrix:
22-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
23-
poetry-version: [ "1.2.2", "1.7.1" ]
25+
python-version: [ "3.10", "3.11", "3.12" ]
2426
os: [ ubuntu-22.04, macos-latest, windows-latest ]
2527
runs-on: ${{ matrix.os }}
2628
steps:
@@ -40,7 +42,7 @@ jobs:
4042
- name: Run image
4143
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8 # v4
4244
with:
43-
poetry-version: ${{ matrix.poetry-version }}
45+
poetry-version: ${{ env.POETRY_VERSION }}
4446

4547
- name: Setup environment
4648
run: poetry install
@@ -57,8 +59,8 @@ jobs:
5759
run: poetry build
5860

5961
- name: SonarCloud Scan
60-
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-22.04' && matrix.poetry-version == '1.7.1'
61-
uses: SonarSource/sonarcloud-github-action@02ef91109b2d589e757aefcfb2854c2783fd7b19 # master
62+
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-22.04'
63+
uses: SonarSource/sonarcloud-github-action@v5
6264
env:
6365
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
6466
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PR automation
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
actions: write
8+
9+
jobs:
10+
dependabot:
11+
runs-on: ubuntu-latest
12+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'wuan/scan-pdf'
13+
steps:
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
- name: Enable auto-merge for Dependabot PRs
20+
# if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
21+
run: gh pr merge --auto --squash "$PR_URL"
22+
env:
23+
PR_URL: ${{github.event.pull_request.html_url}}
24+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6565
# format to the repository Actions tab.
6666
- name: "Upload artifact"
67-
uses: actions/upload-artifact@c24449f33cd45d4826c6702db7e49f7cdb9b551d # v3.pre.node20
67+
uses: actions/upload-artifact@v4
6868
with:
6969
name: SARIF file
7070
path: results.sarif

poetry.lock

Lines changed: 28 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)