🔐 Use PR Submit for pull requests (#1928)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent 47e498a · Browse files · 3 files·+24 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+24 added−13 removed
- other:+24 added−13 removed
Provenance
- Commit
5c58117- Tree
8400bcd- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
47e498a
3 files changed+24 added−13 removed
modified:.github/workflows/bump-pre-commit-hooks.yml+11 added-5 removed
10 unmodified lines1112131415161718192021222324222325262728297 unmodified lines373839404142434445414647484950515253495054555657585960616263649 unmodified lines10 unmodified lines bump-pre-commit-hooks: if: github.repository_owner == 'fastapi' runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read id-token: write steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: token: ${{ secrets.TYPER_LATEST_CHANGES }} persist-credentials: true persist-credentials: false - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version-file: ".python-version"7 unmodified lines pyproject.toml uv.lock - name: Bump pre-commit hooks run: uv run prek auto-update --freeze --cooldown-days 7 - name: Get PR Submit token id: pr-submit uses: tiangolo/pr-submit@d802fdf59bde80bc3eb8bd3259f4cbeec63de4aa # 0.0.1 - name: Create pull request env: GH_TOKEN: ${{ secrets.TYPER_LATEST_CHANGES }} GH_TOKEN: ${{ steps.pr-submit.outputs.token }} BASE_BRANCH: ${{ github.event.repository.default_branch }} run: | set -euo pipefail if git diff --quiet; then echo "No pre-commit hook updates available" exit 0 fi git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git config user.name "pr-submit[bot]" git config user.email "pr-submit[bot]@users.noreply.github.com" branch="bump-pre-commit-hooks" git switch -C "$branch" git add .pre-commit-config.yaml git commit -m "⬆ Bump pre-commit hooks" gh auth setup-git git push --force origin "$branch" if [ -z "$(gh pr list --head "$branch" --state open --json number --jq '.[].number')" ]; then gh pr create \ --base "$BASE_BRANCH" \9 unmodified linesmodified:.github/workflows/prepare-release.yml+10 added-8 removed
21 unmodified lines222324252627282627282930312 unmodified lines343536373940383940414213 unmodified lines5657585960616263646465666768696970707172737475767778793 unmodified lines21 unmodified lines prepare-release: runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: write issues: write pull-requests: write contents: read id-token: write env: PREPARE_RELEASE_VERSION_FILE: typer/__init__.py PREPARE_RELEASE_RELEASE_NOTES_FILE: docs/release-notes.md steps:2 unmodified lines GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: token: ${{ secrets.TYPER_LATEST_CHANGES }} # zizmor: ignore[secrets-outside-env] persist-credentials: true persist-credentials: false - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version-file: ".python-version"13 unmodified lines run: | version="$(uv run python scripts/prepare_release.py current-version)" echo "$version" echo "version=$version" >> "$GITHUB_OUTPUT" - name: Get PR Submit token id: pr-submit uses: tiangolo/pr-submit@d802fdf59bde80bc3eb8bd3259f4cbeec63de4aa # 0.0.1 - name: Create release pull request env: GH_TOKEN: ${{ secrets.TYPER_LATEST_CHANGES }} GH_TOKEN: ${{ steps.pr-submit.outputs.token }} VERSION: ${{ steps.release-version.outputs.version }} run: | set -euo pipefail branch="release-${VERSION}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git config user.name "pr-submit[bot]" git config user.email "pr-submit[bot]@users.noreply.github.com" git switch -c "$branch" git add $PREPARE_RELEASE_VERSION_FILE $PREPARE_RELEASE_RELEASE_NOTES_FILE git commit -m "🔖 Release version ${VERSION}" gh auth setup-git git push --set-upstream origin "$branch" gh pr create \ --base master \ --head "$branch" \3 unmodified linesadded:.github/pr-submit.yml+3 added
123workflows: - .github/workflows/bump-pre-commit-hooks.yml - .github/workflows/prepare-release.yml