From ea70ede5038ad01b465dd1bbfb1f266a3e2c3704 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Apr 2026 07:17:15 +0000 Subject: [PATCH 1/3] fix: prevent mirror-event-log from failing when PAT is missing Agent-Logs-Url: https://github.com/th30d4y/OpenLearnX/sessions/46d635ed-7046-41a5-a1d6-d39ad7d81a99 Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com> --- .github/workflows/mirror-repo-events-to-logs.yml | 7 +++++-- README.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mirror-repo-events-to-logs.yml b/.github/workflows/mirror-repo-events-to-logs.yml index aeeef31..9411aeb 100644 --- a/.github/workflows/mirror-repo-events-to-logs.yml +++ b/.github/workflows/mirror-repo-events-to-logs.yml @@ -28,11 +28,12 @@ jobs: LOGS_REPO_PAT: ${{ secrets.LOGS_REPO_PAT }} run: | if [ -z "$LOGS_REPO_PAT" ]; then - echo "Missing required secret: LOGS_REPO_PAT. See README.md for setup instructions." - exit 1 + echo "::warning::Missing required secret: LOGS_REPO_PAT. Skipping event mirroring. See README.md for setup instructions." + exit 0 fi - name: Checkout logs repository + if: ${{ secrets.LOGS_REPO_PAT != '' }} uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 with: repository: th30d4y/LOGS @@ -40,6 +41,7 @@ jobs: path: logs-repo - name: Append event payload to daily log file + if: ${{ secrets.LOGS_REPO_PAT != '' }} env: SOURCE_REPOSITORY: ${{ github.repository }} SOURCE_EVENT_NAME: ${{ github.event_name }} @@ -98,6 +100,7 @@ jobs: fi - name: Commit and push logs + if: ${{ secrets.LOGS_REPO_PAT != '' }} run: | set -euo pipefail cd logs-repo diff --git a/README.md b/README.md index a4de313..c24890f 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ Add this repository secret in **OpenLearnX**: - `LOGS_REPO_PAT`: a Personal Access Token that can write to `th30d4y/LOGS`. - Fine-grained PAT: grant repository access to `th30d4y/LOGS` with **Contents: Read and write**. - Classic PAT: use **repo** scope. - + - If this secret is missing, the workflow now exits successfully and skips mirroring with a warning message. From dcbeaf2711383fb0c1f9e56df41f85f904a2effc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Apr 2026 07:18:05 +0000 Subject: [PATCH 2/3] fix: gate mirror logging steps via token-check output Agent-Logs-Url: https://github.com/th30d4y/OpenLearnX/sessions/46d635ed-7046-41a5-a1d6-d39ad7d81a99 Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com> --- .github/workflows/mirror-repo-events-to-logs.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mirror-repo-events-to-logs.yml b/.github/workflows/mirror-repo-events-to-logs.yml index 9411aeb..767441d 100644 --- a/.github/workflows/mirror-repo-events-to-logs.yml +++ b/.github/workflows/mirror-repo-events-to-logs.yml @@ -24,16 +24,19 @@ jobs: LOG_ROOT_DIR: openlearnx-events steps: - name: Ensure personal access token exists + id: ensure_pat env: LOGS_REPO_PAT: ${{ secrets.LOGS_REPO_PAT }} run: | if [ -z "$LOGS_REPO_PAT" ]; then echo "::warning::Missing required secret: LOGS_REPO_PAT. Skipping event mirroring. See README.md for setup instructions." - exit 0 + echo "has_pat=false" >> "$GITHUB_OUTPUT" + else + echo "has_pat=true" >> "$GITHUB_OUTPUT" fi - name: Checkout logs repository - if: ${{ secrets.LOGS_REPO_PAT != '' }} + if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }} uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 with: repository: th30d4y/LOGS @@ -41,7 +44,7 @@ jobs: path: logs-repo - name: Append event payload to daily log file - if: ${{ secrets.LOGS_REPO_PAT != '' }} + if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }} env: SOURCE_REPOSITORY: ${{ github.repository }} SOURCE_EVENT_NAME: ${{ github.event_name }} @@ -100,7 +103,7 @@ jobs: fi - name: Commit and push logs - if: ${{ secrets.LOGS_REPO_PAT != '' }} + if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }} run: | set -euo pipefail cd logs-repo From fe9d69df3923308c6ca857e30b9654a13cb8ca06 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Apr 2026 07:18:38 +0000 Subject: [PATCH 3/3] style: simplify workflow if expressions Agent-Logs-Url: https://github.com/th30d4y/OpenLearnX/sessions/46d635ed-7046-41a5-a1d6-d39ad7d81a99 Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com> --- .github/workflows/mirror-repo-events-to-logs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mirror-repo-events-to-logs.yml b/.github/workflows/mirror-repo-events-to-logs.yml index 767441d..f8e6e3a 100644 --- a/.github/workflows/mirror-repo-events-to-logs.yml +++ b/.github/workflows/mirror-repo-events-to-logs.yml @@ -36,7 +36,7 @@ jobs: fi - name: Checkout logs repository - if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }} + if: steps.ensure_pat.outputs.has_pat == 'true' uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 with: repository: th30d4y/LOGS @@ -44,7 +44,7 @@ jobs: path: logs-repo - name: Append event payload to daily log file - if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }} + if: steps.ensure_pat.outputs.has_pat == 'true' env: SOURCE_REPOSITORY: ${{ github.repository }} SOURCE_EVENT_NAME: ${{ github.event_name }} @@ -103,7 +103,7 @@ jobs: fi - name: Commit and push logs - if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }} + if: steps.ensure_pat.outputs.has_pat == 'true' run: | set -euo pipefail cd logs-repo