diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..28cb43e9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Source - https://stackoverflow.com/a/78380165 +# Posted by Stefan, modified by community. See post 'Timeline' for change history +# Retrieved 2026-04-14, License - CC BY-SA 4.0 + +# Set update schedule for GitHub Actions + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index bda74611..0397b112 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -18,7 +18,7 @@ jobs: if: github.event.action != 'closed' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: apt install uses: nick-invision/retry@v2.4.0 @@ -174,7 +174,7 @@ jobs: if: github.event_name == 'pull_request' && github.event.action == 'closed' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Remove preview from gh-pages run: | BRANCH_NAME="${{ github.head_ref }}" diff --git a/build.py b/build.py index d4326c3e..29efbb30 100644 --- a/build.py +++ b/build.py @@ -3,6 +3,7 @@ Creates docs/gsod19/repos-graph.html Requires env `$GITHUB_API_TOKEN` """ + from __future__ import print_function, division import os import sys diff --git a/show-gh-actions-logs.py b/show-gh-actions-logs.py index 2b72375d..73fa4147 100644 --- a/show-gh-actions-logs.py +++ b/show-gh-actions-logs.py @@ -1,27 +1,31 @@ -''' +""" Script to show what happens after checking out the gh-pages branch in recent GH Actions runs. Useful for seeing which jobs caused an unnecessary deploy. -''' +""" + from os.path import expanduser import io import zipfile import requests -token = open(expanduser('~/.gh-token'), 'rt').read().strip() -headers = {"Accept": "application/vnd.github.v3+json", - "Authorization": f"token {token}"} -runs_resp = requests.get('https://api.github.com/repos/openworm/openworm_docs/actions/runs', - headers=headers).json() -runs = runs_resp['workflow_runs'] +token = open(expanduser("~/.gh-token"), "rt").read().strip() +headers = { + "Accept": "application/vnd.github.v3+json", + "Authorization": f"token {token}", +} +runs_resp = requests.get( + "https://api.github.com/repos/openworm/openworm_docs/actions/runs", headers=headers +).json() +runs = runs_resp["workflow_runs"] for run in runs: - run_id = run['id'] - run_number = run['run_number'] - logs_url = run['logs_url'] + run_id = run["id"] + run_number = run["run_number"] + logs_url = run["logs_url"] logs_resp = requests.get(logs_url, headers=headers) logs_zip = io.BytesIO(logs_resp.content) print(f"Run number: {run_number}") with zipfile.ZipFile(logs_zip) as logs_zf: - with logs_zf.open('1_build.txt') as logs_txt: + with logs_zf.open("1_build.txt") as logs_txt: do_print = False for ln in logs_txt: ln = ln.decode().strip()