summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorPradyun Gedam <pradyunsg@users.noreply.github.com>2022-11-25 13:47:05 +0000
committerPradyun Gedam <pradyunsg@users.noreply.github.com>2022-12-30 02:57:24 +0000
commit8328135d934d9136756639606632ab70625242ae (patch)
tree7b65375020047667b01cbb828912c2053856c62c /.github
parentfea8ae9f9ffdabb15d81cbca5636f7ab82fa419c (diff)
downloadpip-8328135d934d9136756639606632ab70625242ae.tar.gz
Add GitHub action for RTD redirect updates
This makes it possible for pip's documentation's redirects to be automatically synchronised with the `main` branch.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/update-rtd-redirects.yml27
1 files changed, 27 insertions, 0 deletions
diff --git a/.github/workflows/update-rtd-redirects.yml b/.github/workflows/update-rtd-redirects.yml
new file mode 100644
index 000000000..5ac9c6313
--- /dev/null
+++ b/.github/workflows/update-rtd-redirects.yml
@@ -0,0 +1,27 @@
+name: Update documentation redirects
+
+on:
+ push:
+ branches: [main]
+ schedule:
+ - cron: 0 0 * * MON # Run every Monday at 00:00 UTC
+
+env:
+ FORCE_COLOR: "1"
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
+ cancel-in-progress: true
+
+jobs:
+ update-rtd-redirects:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: "3.11"
+ - run: pip install httpx requests pyyaml
+ - run: python tools/update-rtd-redirects.py
+ env:
+ RTD_API_TOKEN: ${{ secrets.RTD_API_TOKEN }}