-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also have zizmor check for low-severity security issues
- Loading branch information
1 parent
ab26d9c
commit 4c5b011
Showing
5 changed files
with
24 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,13 +49,11 @@ jobs: | |
- name: "Set branch name" | ||
run: | | ||
version="${{ env.version }}" | ||
display_name="${{ env.display_name }}" | ||
timestamp="$(date +%s)" | ||
# create branch_display_name from display_name by replacing all | ||
# characters disallowed in git branch names with hyphens | ||
branch_display_name="$(echo "$display_name" | tr -c '[:alnum:]._' '-' | tr -s '-')" | ||
branch_display_name="$(echo "${display_name}" | tr -c '[:alnum:]._' '-' | tr -s '-')" | ||
echo "branch_name=update-docs-$branch_display_name-$timestamp" >> $GITHUB_ENV | ||
echo "timestamp=$timestamp" >> $GITHUB_ENV | ||
|
@@ -93,22 +91,18 @@ jobs: | |
run: mkdocs build --strict -f mkdocs.public.yml | ||
|
||
- name: "Clone docs repo" | ||
run: | | ||
version="${{ env.version }}" | ||
git clone https://${{ secrets.ASTRAL_DOCS_PAT }}@github.com/astral-sh/docs.git astral-docs | ||
run: git clone https://${{ secrets.ASTRAL_DOCS_PAT }}@github.com/astral-sh/docs.git astral-docs | ||
|
||
- name: "Copy docs" | ||
run: rm -rf astral-docs/site/ruff && mkdir -p astral-docs/site && cp -r site/ruff astral-docs/site/ | ||
|
||
- name: "Commit docs" | ||
working-directory: astral-docs | ||
run: | | ||
branch_name="${{ env.branch_name }}" | ||
git config user.name "astral-docs-bot" | ||
git config user.email "[email protected]" | ||
git checkout -b $branch_name | ||
git checkout -b "${branch_name}" | ||
git add site/ruff | ||
git commit -m "Update ruff documentation for $version" | ||
|
@@ -117,12 +111,8 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.ASTRAL_DOCS_PAT }} | ||
run: | | ||
version="${{ env.version }}" | ||
display_name="${{ env.display_name }}" | ||
branch_name="${{ env.branch_name }}" | ||
# set the PR title | ||
pull_request_title="Update ruff documentation for $display_name" | ||
pull_request_title="Update ruff documentation for "${display_name}"" | ||
# Delete any existing pull requests that are open for this version | ||
# by checking against pull_request_title because the new PR will | ||
|
@@ -131,12 +121,12 @@ jobs: | |
xargs -I {} gh pr close {} | ||
# push the branch to GitHub | ||
git push origin $branch_name | ||
git push origin "${branch_name}" | ||
# create the PR | ||
gh pr create --base main --head $branch_name \ | ||
gh pr create --base main --head "${branch_name}" \ | ||
--title "$pull_request_title" \ | ||
--body "Automated documentation update for $display_name" \ | ||
--body "Automated documentation update for "${display_name}"" \ | ||
--label "documentation" | ||
- name: "Merge Pull Request" | ||
|
@@ -145,9 +135,7 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.ASTRAL_DOCS_PAT }} | ||
run: | | ||
branch_name="${{ env.branch_name }}" | ||
# auto-merge the PR if the build was triggered by a release. Manual builds should be reviewed by a human. | ||
# give the PR a few seconds to be created before trying to auto-merge it | ||
sleep 10 | ||
gh pr merge --squash $branch_name | ||
gh pr merge --squash "${branch_name}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters