-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
33 lines (29 loc) · 1007 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: 'Codecrafters Test'
description: 'Run codecrafters tests on your code from github'
branding:
icon: 'check-square'
color: 'purple'
inputs:
remote-url:
description: 'The git remote URL used to push code on codecrafters'
required: true
runs:
using: 'composite'
steps:
- run: |
# Save the original remote URL
ORIGINAL_REMOTE=$(git remote get-url origin)
echo "Original remote: $ORIGINAL_REMOTE"
curl https://codecrafters.io/install.sh | sh
# Setting up git
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git fetch --unshallow origin
git remote rm origin
git remote add origin ${{ inputs.remote-url }}
# Run tests
codecrafters test
# Restore the original remote URL
git remote rm origin
git remote add origin $ORIGINAL_REMOTE
shell: bash