-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to main from @ KyoriPowered/adventure-docs@355b378 🚀
- Loading branch information
0 parents
commit 4ca5189
Showing
1,542 changed files
with
239,775 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: "cleanup old builds" | ||
|
||
on: | ||
schedule: | ||
- cron: '14 1 * * *' | ||
workflow_dispatch: | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
cleanup: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v3" | ||
- name: "setup python ${{ env.PYTHON_VERSION }}" | ||
uses: "actions/setup-python@v4" | ||
with: | ||
python-version: "${{ env.PYTHON_VERSION }}" | ||
cache: "pip" | ||
cache-dependency-path: "_scripts/requirements.txt" | ||
- name: "install dependencies" | ||
run: "pip install -r _scripts/requirements.txt" | ||
- name: "cleanup old PRs" | ||
run: | | ||
git config user.name "kyori-bot" | ||
git config user.email "[email protected]" | ||
python _scripts/cleanup.py . | ||
git commit -a -m 'cleanup outdated previews' || true | ||
git push |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
|
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env python | ||
|
||
import datetime | ||
import dateutil.parser | ||
import json | ||
from pathlib import Path | ||
import shutil | ||
|
||
|
||
now = datetime.datetime.now(datetime.timezone.utc) | ||
cutoff = now - datetime.timedelta(days = 90) | ||
|
||
|
||
def stale(pull: Path) -> bool: | ||
info_path = pull / '_preview_data.json' | ||
|
||
try: | ||
with info_path.open('rt') as fp: | ||
info = json.load(fp) | ||
except json.JSONDecodeError: | ||
print(f"::error file={info_path.absolute}::Invalid build info for pull #{pull.name}") | ||
|
||
pr_time = dateutil.parser.isoparse(info['time']) | ||
|
||
return pr_time < cutoff | ||
|
||
|
||
def cleanup(base: Path, deleted): | ||
for pull in base.iterdir(): | ||
if pull.is_dir: | ||
if stale(pull): | ||
shutil.rmtree(pull) | ||
deleted(pull) | ||
|
||
|
||
if __name__ == "__main__": | ||
from sys import argv | ||
from os import environ | ||
if len(argv) < 2: | ||
print(f"Not enough arguments! Usage: {argv[0]} <repo>") | ||
exit(1) | ||
|
||
dest = Path(argv[1]) / 'pull' | ||
if 'GITHUB_STEP_SUMMARY' in environ: | ||
with open(environ['GITHUB_STEP_SUMMARY'], 'at') as fp: | ||
fp.write("# Cleaned up previews\n\n") | ||
cleanup(dest, lambda path: fp.write(f'- `#{path.name}`\n')) | ||
else: | ||
cleanup(dest, lambda _: None) | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
python-dateutil |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 759375a2c7233b3b31a695843c4cb595 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"pr":"144","time":"2023-10-04T14:31:21.879Z"} |
1 change: 1 addition & 0 deletions
1
pull/144/_sphinx_design_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var sd_labels_by_text = {}; | ||
|
||
function ready() { | ||
const li = document.getElementsByClassName("sd-tab-label"); | ||
for (const label of li) { | ||
syncId = label.getAttribute("data-sync-id"); | ||
if (syncId) { | ||
label.onclick = onLabelClick; | ||
if (!sd_labels_by_text[syncId]) { | ||
sd_labels_by_text[syncId] = []; | ||
} | ||
sd_labels_by_text[syncId].push(label); | ||
} | ||
} | ||
} | ||
|
||
function onLabelClick() { | ||
// Activate other inputs with the same sync id. | ||
syncId = this.getAttribute("data-sync-id"); | ||
for (label of sd_labels_by_text[syncId]) { | ||
if (label === this) continue; | ||
label.previousElementSibling.checked = true; | ||
} | ||
window.localStorage.setItem("sphinx-design-last-tab", syncId); | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", ready, false); |
Oops, something went wrong.