Skip to content

Commit 2e9aaf9

Browse files
committed
fix: pass github.event.before
1 parent 0a4c60c commit 2e9aaf9

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ runs:
5151
env:
5252
INPUT_DEPLOY_DIRECTORY: ${{ inputs.deploy-directory }}
5353
INPUT_BASE_REF: ${{ inputs.base-ref }}
54+
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
5455
run: bash ${{ github.action_path }}/scripts/detect-challenges.sh
5556

5657
- name: Sync challenges

scripts/detect-challenges.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ if [ -z "$BASE_REF" ]; then
1212
fi
1313
fi
1414

15+
if [ -n "$BASE_REF" ]; then
16+
if ! git cat-file -e "$BASE_REF" 2>/dev/null; then
17+
echo "Base ref $BASE_REF not in shallow clone, fetching..."
18+
git fetch --depth=1 origin "$BASE_REF" 2>/dev/null || BASE_REF=""
19+
fi
20+
fi
21+
1522
if [ -z "$BASE_REF" ]; then
1623
echo "No base ref available (initial push?) — syncing all challenges"
1724
echo "should_sync=true" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)