Skip to content

Commit 74b34c6

Browse files
authored
🔧 Add configs for .github (#1)
1 parent 9561fb7 commit 74b34c6

File tree

8 files changed

+208
-0
lines changed

8 files changed

+208
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [tiangolo]

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
commit-message:
9+
prefix:
10+
# Python
11+
- package-ecosystem: "uv"
12+
directory: "/"
13+
schedule:
14+
interval: "monthly"
15+
commit-message:
16+
prefix:

.github/labeler.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
internal:
2+
- all:
3+
- changed-files:
4+
- any-glob-to-any-file:
5+
- .github/**
6+
- scripts/**
7+
- .gitignore
8+
- .pre-commit-config.yaml
9+
- all-globs-to-all-files:
10+
- '!src/**'
11+
- '!pyproject.toml'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Conflict detector
2+
on:
3+
push:
4+
pull_request_target:
5+
types:
6+
- synchronize
7+
8+
jobs:
9+
main:
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check if PRs have merge conflicts
16+
uses: eps1lon/actions-label-merge-conflict@v3
17+
with:
18+
dirtyLabel: conflicts
19+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
20+
commentOnDirty: This pull request has a merge conflict that needs to be resolved.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Issue Manager
2+
3+
on:
4+
schedule:
5+
- cron: "13 22 * * *"
6+
issue_comment:
7+
types:
8+
- created
9+
issues:
10+
types:
11+
- labeled
12+
pull_request_target:
13+
types:
14+
- labeled
15+
workflow_dispatch:
16+
17+
permissions:
18+
issues: write
19+
pull-requests: write
20+
21+
jobs:
22+
issue-manager:
23+
if: github.repository_owner == 'fastapi'
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Dump GitHub context
27+
env:
28+
GITHUB_CONTEXT: ${{ toJson(github) }}
29+
run: echo "$GITHUB_CONTEXT"
30+
- uses: tiangolo/[email protected]
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
config: >
34+
{
35+
"answered": {
36+
"delay": 864000,
37+
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
38+
},
39+
"waiting": {
40+
"delay": 2628000,
41+
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR.",
42+
"reminder": {
43+
"before": "P3D",
44+
"message": "Heads-up: this will be closed in 3 days unless there's new activity."
45+
}
46+
},
47+
"invalid": {
48+
"delay": 0,
49+
"message": "This was marked as invalid and will be closed now. If this is an error, please provide additional details."
50+
}
51+
}

.github/workflows/labeler.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Labels
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
# For label-checker
9+
- labeled
10+
- unlabeled
11+
12+
jobs:
13+
labeler:
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/labeler@v6
20+
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
21+
- run: echo "Done adding labels"
22+
# Run this after labeler applied labels
23+
check-labels:
24+
needs:
25+
- labeler
26+
permissions:
27+
pull-requests: read
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: docker://agilepathway/pull-request-label-checker:latest
31+
with:
32+
one_of: breaking,security,feature,bug,refactor,upgrade,docs,lang-all,internal
33+
repo_token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Latest Changes
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- master
7+
types:
8+
- closed
9+
workflow_dispatch:
10+
inputs:
11+
number:
12+
description: PR number
13+
required: true
14+
debug_enabled:
15+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
16+
required: false
17+
default: 'false'
18+
19+
jobs:
20+
latest-changes:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Dump GitHub context
24+
env:
25+
GITHUB_CONTEXT: ${{ toJson(github) }}
26+
run: echo "$GITHUB_CONTEXT"
27+
- uses: actions/checkout@v5
28+
with:
29+
# To allow latest-changes to commit to the main branch
30+
token: ${{ secrets.ANNOTATED_DOC_LATEST_CHANGES }}
31+
# Allow debugging with tmate
32+
- name: Setup tmate session
33+
uses: mxschmitt/action-tmate@v3
34+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
35+
with:
36+
limit-access-to-actor: true
37+
- uses: tiangolo/[email protected]
38+
with:
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
latest_changes_file: release-notes.md
41+
latest_changes_header: '## Latest Changes'
42+
end_regex: '^## '
43+
debug_logs: true
44+
label_header_prefix: '### '

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
steps:
14+
- name: Dump GitHub context
15+
env:
16+
GITHUB_CONTEXT: ${{ toJson(github) }}
17+
run: echo "$GITHUB_CONTEXT"
18+
- uses: actions/checkout@v5
19+
- name: Set up Python
20+
uses: actions/setup-python@v6
21+
with:
22+
python-version: "3.10"
23+
- name: Install build dependencies
24+
run: pip install build
25+
- name: Build distribution
26+
run: python -m build
27+
- name: Publish
28+
uses: pypa/[email protected]
29+
- name: Dump GitHub context
30+
env:
31+
GITHUB_CONTEXT: ${{ toJson(github) }}
32+
run: echo "$GITHUB_CONTEXT"

0 commit comments

Comments
 (0)