From 94356ac6f4e37aab6a77df1090a27365914501b3 Mon Sep 17 00:00:00 2001 From: m-jahn Date: Sat, 20 Dec 2025 23:39:05 +0100 Subject: [PATCH 1/6] fix: try adding permissions to query repo data --- .github/workflows/deploy.yml | 5 +++++ .github/workflows/test-deploy.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index db28656..ccff2be 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,10 @@ on: jobs: generate-page: runs-on: ubuntu-latest + permissions: + members: read + contents: read + metadata: read steps: - uses: actions/checkout@v6 @@ -30,6 +34,7 @@ jobs: build: name: Build Docusaurus runs-on: ubuntu-latest + needs: generate-page steps: - uses: actions/checkout@v6 with: diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 0341026..2bd9d73 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -7,6 +7,10 @@ on: jobs: generate-page: runs-on: ubuntu-latest + permissions: + members: read + contents: read + metadata: read steps: - uses: actions/checkout@v6 @@ -28,6 +32,7 @@ jobs: test-deploy: name: Test deployment runs-on: ubuntu-latest + needs: generate-page steps: - uses: actions/checkout@v6 with: From 110de9d158f7af611838e7fe4eb8dcc2a2892095 Mon Sep 17 00:00:00 2001 From: m-jahn Date: Sun, 21 Dec 2025 00:03:45 +0100 Subject: [PATCH 2/6] fix: changed permissions --- .github/workflows/deploy.yml | 2 -- .github/workflows/test-deploy.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ccff2be..850ce3e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,9 +10,7 @@ jobs: generate-page: runs-on: ubuntu-latest permissions: - members: read contents: read - metadata: read steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 2bd9d73..ad72c68 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -8,9 +8,7 @@ jobs: generate-page: runs-on: ubuntu-latest permissions: - members: read contents: read - metadata: read steps: - uses: actions/checkout@v6 From 8d18c0718cb04ea5d6e8121e45cdef7d7a788258 Mon Sep 17 00:00:00 2001 From: m-jahn Date: Sun, 21 Dec 2025 00:18:18 +0100 Subject: [PATCH 3/6] fix: removed unnecessary logging --- src/scripts/generate_page.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/generate_page.py b/src/scripts/generate_page.py index 4d30093..eef757c 100644 --- a/src/scripts/generate_page.py +++ b/src/scripts/generate_page.py @@ -80,9 +80,9 @@ def get_config_readme(repo_name): # ---------------------------- # query information from github about the organization gh_instance = Github(auth=Auth.Token(os.environ["GITHUB_TOKEN"])) -logger.info("authenticated to Github as %s", gh_instance.get_user().login) +logger.info("authenticated to Github API") gh_org = gh_instance.get_organization("MPUSP") -logger.info("fetching data for organization %s", gh_org.login) +logger.info("fetching data for organization) # get members and their stats members = {} From 1afbff360d048ffa9dc97d8a54c02a943c454491 Mon Sep 17 00:00:00 2001 From: m-jahn Date: Sun, 21 Dec 2025 00:20:01 +0100 Subject: [PATCH 4/6] fix: syntax bug --- src/scripts/generate_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/generate_page.py b/src/scripts/generate_page.py index eef757c..29e883b 100644 --- a/src/scripts/generate_page.py +++ b/src/scripts/generate_page.py @@ -82,7 +82,7 @@ def get_config_readme(repo_name): gh_instance = Github(auth=Auth.Token(os.environ["GITHUB_TOKEN"])) logger.info("authenticated to Github API") gh_org = gh_instance.get_organization("MPUSP") -logger.info("fetching data for organization) +logger.info("fetching data for organization") # get members and their stats members = {} From 9e2431fd87864dfb6a12024215473761788bcb69 Mon Sep 17 00:00:00 2001 From: m-jahn Date: Sun, 21 Dec 2025 00:28:16 +0100 Subject: [PATCH 5/6] fix: failsafe query for deployments --- src/scripts/generate_page.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/scripts/generate_page.py b/src/scripts/generate_page.py index 29e883b..a1afac8 100644 --- a/src/scripts/generate_page.py +++ b/src/scripts/generate_page.py @@ -29,6 +29,15 @@ def get_total_commits(repo): return counts +def get_total_deployments(repo): + """Get total deployments in a repository.""" + try: + counts = repo.get_deployments().totalCount + except: + counts = 0 + return counts + + def get_commit_history(repo): """Get commit history for a repository.""" total = get_total_commits(repo) @@ -123,7 +132,7 @@ def get_config_readme(repo_name): else None ), "contributors": repo.get_contributors().totalCount, - "deployments": repo.get_deployments().totalCount, + "deployments": get_total_deployments(repo), "downloads": sum( asset.download_count for release in repo.get_releases() From 7f74cbf2b87e23f787b7ca590360a0ef032c368c Mon Sep 17 00:00:00 2001 From: m-jahn Date: Sun, 21 Dec 2025 21:31:25 +0100 Subject: [PATCH 6/6] fix: added generated page data as build artefacts --- .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ .github/workflows/test-deploy.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 850ce3e..7072228 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,6 +29,18 @@ jobs: python src/scripts/generate_page.py python src/scripts/generate_workflow_md.py + - name: Upload page data + uses: actions/upload-artifact@v4 + with: + name: generated-data + path: static/data/*.json + + - name: Upload workflow data + uses: actions/upload-artifact@v4 + with: + name: generated-workflows + path: docs/workflows/all_workflows/*.md + build: name: Build Docusaurus runs-on: ubuntu-latest @@ -37,6 +49,19 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + + - name: Download generated data + uses: actions/download-artifact@v4 + with: + name: generated-data + path: static/data/ + + - name: Download generated workflows + uses: actions/download-artifact@v4 + with: + name: generated-workflows + path: docs/workflows/all_workflows/ + - uses: actions/setup-node@v6 with: node-version: 18 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index ad72c68..2420c96 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -27,6 +27,18 @@ jobs: python src/scripts/generate_page.py python src/scripts/generate_workflow_md.py + - name: Upload page data + uses: actions/upload-artifact@v4 + with: + name: generated-data + path: static/data/*.json + + - name: Upload workflow data + uses: actions/upload-artifact@v4 + with: + name: generated-workflows + path: docs/workflows/all_workflows/*.md + test-deploy: name: Test deployment runs-on: ubuntu-latest @@ -35,6 +47,19 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + + - name: Download generated data + uses: actions/download-artifact@v4 + with: + name: generated-data + path: static/data/ + + - name: Download generated workflows + uses: actions/download-artifact@v4 + with: + name: generated-workflows + path: docs/workflows/all_workflows/ + - uses: actions/setup-node@v6 with: node-version: 18 @@ -42,5 +67,6 @@ jobs: - name: Install dependencies run: npm ci + - name: Test build website run: npm run build