mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-26 19:26:33 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
ea70ede503
commit
dcbeaf2711
@@ -24,16 +24,19 @@ jobs:
|
|||||||
LOG_ROOT_DIR: openlearnx-events
|
LOG_ROOT_DIR: openlearnx-events
|
||||||
steps:
|
steps:
|
||||||
- name: Ensure personal access token exists
|
- name: Ensure personal access token exists
|
||||||
|
id: ensure_pat
|
||||||
env:
|
env:
|
||||||
LOGS_REPO_PAT: ${{ secrets.LOGS_REPO_PAT }}
|
LOGS_REPO_PAT: ${{ secrets.LOGS_REPO_PAT }}
|
||||||
run: |
|
run: |
|
||||||
if [ -z "$LOGS_REPO_PAT" ]; then
|
if [ -z "$LOGS_REPO_PAT" ]; then
|
||||||
echo "::warning::Missing required secret: LOGS_REPO_PAT. Skipping event mirroring. See README.md for setup instructions."
|
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
|
fi
|
||||||
|
|
||||||
- name: Checkout logs repository
|
- name: Checkout logs repository
|
||||||
if: ${{ secrets.LOGS_REPO_PAT != '' }}
|
if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }}
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
with:
|
with:
|
||||||
repository: th30d4y/LOGS
|
repository: th30d4y/LOGS
|
||||||
@@ -41,7 +44,7 @@ jobs:
|
|||||||
path: logs-repo
|
path: logs-repo
|
||||||
|
|
||||||
- name: Append event payload to daily log file
|
- name: Append event payload to daily log file
|
||||||
if: ${{ secrets.LOGS_REPO_PAT != '' }}
|
if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }}
|
||||||
env:
|
env:
|
||||||
SOURCE_REPOSITORY: ${{ github.repository }}
|
SOURCE_REPOSITORY: ${{ github.repository }}
|
||||||
SOURCE_EVENT_NAME: ${{ github.event_name }}
|
SOURCE_EVENT_NAME: ${{ github.event_name }}
|
||||||
@@ -100,7 +103,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Commit and push logs
|
- name: Commit and push logs
|
||||||
if: ${{ secrets.LOGS_REPO_PAT != '' }}
|
if: ${{ steps.ensure_pat.outputs.has_pat == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd logs-repo
|
cd logs-repo
|
||||||
|
|||||||
Reference in New Issue
Block a user