Skip to content

Commit 95f464c

Browse files
authored
Merge branch 'main' into update_sync_with_upstream
2 parents 09592ff + af2d9af commit 95f464c

12 files changed

+231
-27
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: pip
9+
directory: /docs/source
10+
schedule:
11+
interval: daily

.github/workflows/build.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,39 @@ name: Python tests
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
test:
710
runs-on: ubuntu-latest
811
strategy:
912
matrix:
1013
python:
11-
- { VERSION: "3.7", TOXENV: "py37", ALLOW_FAILURE: false }
12-
- { VERSION: "3.8", TOXENV: "py38", ALLOW_FAILURE: false }
1314
- { VERSION: "3.9", TOXENV: "py39", ALLOW_FAILURE: false }
1415
- { VERSION: "3.10", TOXENV: "py310", ALLOW_FAILURE: false }
1516
- { VERSION: "3.11", TOXENV: "py311", ALLOW_FAILURE: false }
17+
- { VERSION: "3.12", TOXENV: "py312", ALLOW_FAILURE: false }
18+
- { VERSION: "3.13", TOXENV: "py313", ALLOW_FAILURE: false }
1619
- {
17-
VERSION: "3.11",
20+
VERSION: "3.13",
1821
TOXENV: "flake8,doclint,docs,commitlint",
1922
ALLOW_FAILURE: false,
2023
}
21-
- { VERSION: "3.11", TOXENV: "docstrings", ALLOW_FAILURE: true }
24+
- { VERSION: "3.13", TOXENV: "docstrings", ALLOW_FAILURE: true }
2225
- { VERSION: "pypy3.9", TOXENV: "pypy", ALLOW_FAILURE: false }
2326

2427
steps:
28+
- name: Harden the runner (Audit all outbound calls)
29+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
30+
with:
31+
egress-policy: audit
32+
2533
- name: Check out the repository
26-
uses: actions/checkout@v3
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2735

2836
- name: Setup Python
29-
uses: actions/setup-python@v4.2.0
37+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3038
with:
3139
python-version: ${{ matrix.PYTHON.VERSION }}
3240

.github/workflows/codeql-analysis.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
schedule:
2121
- cron: '32 17 * * 6'
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
analyze:
2528
name: Analyze
@@ -37,12 +40,17 @@ jobs:
3740
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3841

3942
steps:
43+
- name: Harden the runner (Audit all outbound calls)
44+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
45+
with:
46+
egress-policy: audit
47+
4048
- name: Checkout repository
41-
uses: actions/checkout@v2
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4250

4351
# Initializes the CodeQL tools for scanning.
4452
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
53+
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
4654
with:
4755
languages: ${{ matrix.language }}
4856
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +61,7 @@ jobs:
5361
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5462
# If this step fails, then you should remove it and run the build manually (see below)
5563
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
64+
uses: github/codeql-action/autobuild@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
5765

5866
# ℹ️ Command-line programs to run using the OS shell.
5967
# 📚 https://git.io/JvXDl
@@ -67,4 +75,4 @@ jobs:
6775
# make release
6876

6977
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
78+
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
21+
with:
22+
egress-policy: audit
23+
24+
- name: 'Checkout Repository'
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: 'Dependency Review'
27+
uses: actions/dependency-review-action@67d4f4bd7a9b17a0db54d2a7519187c65e339de8 # v4

.github/workflows/docs.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ name: Check documentation
1313
- "**.rst"
1414
- "docs/**"
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
docs:
1821
name: Build documentation & check links
1922
runs-on: ubuntu-latest
2023
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-python@v4
24+
- name: Harden the runner (Audit all outbound calls)
25+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
26+
with:
27+
egress-policy: audit
28+
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2331
with:
2432
python-version: "3.11"
2533

@@ -39,7 +47,7 @@ jobs:
3947
TOXENV: docs
4048

4149
- name: Upload documentation
42-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4351
with:
4452
name: docs
4553
path: docs/build

.github/workflows/labeler.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@ on:
66
- main
77
- master
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
labeler:
14+
permissions:
15+
contents: read # for actions/checkout to fetch code
16+
issues: write # for crazy-max/ghaction-github-labeler to create, rename, update and delete label
1117
runs-on: ubuntu-latest
1218
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
21+
with:
22+
egress-policy: audit
23+
1324
- name: Check out the repository
14-
uses: actions/checkout@v2.3.3
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1526

1627
- name: Run Labeler
17-
uses: crazy-max/ghaction-github-labeler@v3.1.1
28+
uses: crazy-max/ghaction-github-labeler@24d110aa46a59976b8a7f35518cb7f14f434c916 # v5.3.0
1829
with:
1930
skip-delete: true

.github/workflows/release.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@ jobs:
1818
hashes: ${{ steps.hash.outputs.hashes }}
1919

2020
steps:
21+
- name: Harden the runner (Audit all outbound calls)
22+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
23+
with:
24+
egress-policy: audit
25+
2126
- name: "Checkout repository"
22-
uses: "actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3"
27+
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
2328

2429
- name: "Setup Python"
25-
uses: "actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b"
30+
uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065"
2631
with:
2732
python-version: "3.x"
2833

@@ -40,7 +45,7 @@ jobs:
4045
cd dist && echo "::set-output name=hashes::$(sha256sum * | base64 -w0)"
4146
4247
- name: "Upload dists"
43-
uses: "actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce"
48+
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
4449
with:
4550
name: "dist"
4651
path: "dist/"
@@ -53,7 +58,7 @@ jobs:
5358
actions: read
5459
contents: write
5560
id-token: write # Needed to access the workflow's OIDC identity.
56-
uses: "slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.5.0"
61+
uses: "slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0"
5762
with:
5863
base64-subjects: "${{ needs.build.outputs.hashes }}"
5964
upload-assets: true
@@ -69,11 +74,16 @@ jobs:
6974
runs-on: "ubuntu-latest"
7075

7176
steps:
77+
- name: Harden the runner (Audit all outbound calls)
78+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
79+
with:
80+
egress-policy: audit
81+
7282
- name: "Download dists"
73-
uses: "actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a"
83+
uses: "actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093"
7484
with:
7585
name: "dist"
7686
path: "dist/"
7787

7888
- name: "Publish dists to PyPI"
79-
uses: "pypa/gh-action-pypi-publish@48b317d84d5f59668bb13be49d1697e36b3ad009"
89+
uses: "pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc"

.github/workflows/scorecards.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '20 7 * * 2'
14+
push:
15+
branches: ["main"]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
contents: read
30+
actions: read
31+
# To allow GraphQL ListCommits to work
32+
issues: read
33+
pull-requests: read
34+
# To detect SAST tools
35+
checks: read
36+
37+
steps:
38+
- name: Harden the runner (Audit all outbound calls)
39+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
40+
with:
41+
egress-policy: audit
42+
43+
- name: "Checkout code"
44+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
45+
with:
46+
persist-credentials: false
47+
48+
- name: "Run analysis"
49+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
50+
with:
51+
results_file: results.sarif
52+
results_format: sarif
53+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
54+
# - you want to enable the Branch-Protection check on a *public* repository, or
55+
# - you are installing Scorecards on a *private* repository
56+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
57+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
58+
59+
# Public repositories:
60+
# - Publish results to OpenSSF REST API for easy access by consumers
61+
# - Allows the repository to include the Scorecard badge.
62+
# - See https://github.com/ossf/scorecard-action#publishing-results.
63+
# For private repositories:
64+
# - `publish_results` will always be set to `false`, regardless
65+
# of the value entered here.
66+
publish_results: true
67+
68+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
69+
# format to the repository Actions tab.
70+
- name: "Upload artifact"
71+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
72+
with:
73+
name: SARIF file
74+
path: results.sarif
75+
retention-days: 5
76+
77+
# Upload the results to GitHub's code scanning dashboard.
78+
- name: "Upload to code-scanning"
79+
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
80+
with:
81+
sarif_file: results.sarif

.pre-commit-config.yaml

+9-5
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ repos:
1414
types: [text]
1515
stages: [pre-commit, pre-push, manual]
1616
- repo: https://github.com/PyCQA/isort
17-
rev: 5.13.2
17+
rev: 6.0.1
1818
hooks:
1919
- id: isort
2020
- repo: https://github.com/psf/black
21-
rev: 24.10.0
21+
rev: 25.1.0
2222
hooks:
2323
- id: black
2424
- repo: https://github.com/asottile/pyupgrade
25-
rev: v3.17.0
25+
rev: v3.19.1
2626
hooks:
2727
- id: pyupgrade
2828
args: [--py37-plus]
2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v1.11.2
30+
rev: v1.15.0
3131
hooks:
3232
- id: mypy
3333
additional_dependencies:
@@ -39,7 +39,11 @@ repos:
3939
hooks:
4040
- id: gitlint
4141
- repo: https://github.com/asottile/setup-cfg-fmt
42-
rev: v2.5.0
42+
rev: v2.8.0
4343
hooks:
4444
- id: setup-cfg-fmt
4545
args: [--min-py3-version, '3.7']
46+
- repo: https://github.com/gitleaks/gitleaks
47+
rev: v8.24.3
48+
hooks:
49+
- id: gitleaks

SECURITY.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Security Policy
2+
3+
github3.py takes security seriously. Any vulnerability discovered in the
4+
library will be addressed with best possible urgency. This is, however,
5+
a passion project that I may not have enough time to spend in order to fix
6+
a larger security issue in an expedient fashion.
7+
8+
All reports will be responded to within 7 days.
9+
10+
## Supported Versions
11+
12+
The latest version is the only supported version for security reports. We do
13+
not maintain branches for older versions or long term support releases.
14+
15+
## Reporting a Vulnerability
16+
17+
Please use the security tab on GitHub to report a vulnerability. If this is
18+
insufficient, please use the email address for @sigmavirus24.

0 commit comments

Comments
 (0)