.
Some checks failed
resume.yml / . (push) Failing after 0s
Spell Check / Check spelling (push) Successful in 8s
vale / runner / vale (push) Successful in 4s

This commit is contained in:
g_it 2026-04-08 16:48:53 +02:00
commit 7e2570acbc
Signed by untrusted user who does not match committer: g_it
GPG key ID: A2B0A7C06A054627

View file

@ -27,70 +27,63 @@ jobs:
fi
- name: Validate with Ollama
if: steps.extract.outputs.content_found == 'true'
id: validate
run: |
RESUME=$(cat /tmp/resume.txt)
if: steps.extract.outputs.content_found == 'true'
id: validate
run: |
RESUME=$(cat /tmp/resume.txt)
PROMPT="You are a recruiting manager evaluating candidates for a Technical Writing position.
PROMPT="You are a recruiting manager evaluating candidates for a Technical Writing position.
Assess this resume on:
1. Tone: Is it professional, confident, and appropriate for technical communication roles?
2. Understandability: Is the writing clear, well-organized, and easy to follow?
3. Technical Writing Skills: Does the candidate demonstrate ability to explain complex concepts clearly?
Assess this resume on:
1. Tone: Is it professional, confident, and appropriate for technical communication roles?
2. Understandability: Is the writing clear, well-organized, and easy to follow?
3. Technical Writing Skills: Does the candidate demonstrate ability to explain complex concepts clearly?
Resume:
$RESUME
Resume:
$RESUME
Respond with JSON:
{
\"tone\": \"brief assessment\",
\"understandability\": \"brief assessment\",
\"assessment\": \"PASS or FAIL\",
\"reason\": \"one sentence explaining your decision\"
}"
Respond with JSON:
{
\"tone\": \"brief assessment\",
\"understandability\": \"brief assessment\",
\"assessment\": \"PASS or FAIL\",
\"reason\": \"one sentence explaining your decision\"
}"
RESPONSE=$(curl -s -X POST http://ollama:11434/api/generate \
-H "Content-Type: application/json" \
-d "{
\"model\": \"phi:2.7b\",
\"prompt\": $(echo "$PROMPT" | jq -Rs .),
\"stream\": false
}")
echo "Testing Ollama connectivity..."
curl -v http://ollama:11434/api/tags || echo "Ollama unreachable"
RESULT=$(echo "$RESPONSE" | jq -r '.response')
echo "validation_result=$RESULT" >> $GITHUB_OUTPUT
echo "$RESULT"
echo "Sending validation request to Ollama..."
RESPONSE=$(curl -s -X POST http://ollama:11434/api/generate \
-H "Content-Type: application/json" \
--max-time 300 \
-d "{
\"model\": \"phi:2.7b\",
\"prompt\": $(echo "$PROMPT" | jq -Rs .),
\"stream\": false
}")
- name: Parse validation result
if: steps.extract.outputs.content_found == 'true'
id: parse
run: |
RESULT="${{ steps.validate.outputs.validation_result }}"
echo "Raw response:"
echo "$RESPONSE"
echo "---"
JSON=$(echo "$RESULT" | grep -o '{.*}' | head -1)
if [ -z "$RESPONSE" ]; then
echo "Error: No response from Ollama"
exit 1
fi
if [ -z "$JSON" ]; then
echo "Could not parse response as JSON"
echo "assessment=FAIL" >> $GITHUB_OUTPUT
exit 1
fi
RESULT=$(echo "$RESPONSE" | jq -r '.response' 2>/dev/null)
ASSESSMENT=$(echo "$JSON" | jq -r '.assessment')
TONE=$(echo "$JSON" | jq -r '.tone')
UNDERSTANDABILITY=$(echo "$JSON" | jq -r '.understandability')
REASON=$(echo "$JSON" | jq -r '.reason')
if [ -z "$RESULT" ] || [ "$RESULT" = "null" ]; then
echo "Error: Could not extract response from Ollama"
echo "Response was: $RESPONSE"
exit 1
fi
echo "assessment=$ASSESSMENT" >> $GITHUB_OUTPUT
echo "tone=$TONE" >> $GITHUB_OUTPUT
echo "understandability=$UNDERSTANDABILITY" >> $GITHUB_OUTPUT
echo "reason=$REASON" >> $GITHUB_OUTPUT
echo "Ollama response:"
echo "$RESULT"
echo "validation_result=$RESULT" >> $GITHUB_OUTPUT
echo "---"
echo "Assessment: $ASSESSMENT"
echo "Tone: $TONE"
echo "Understandability: $UNDERSTANDABILITY"
echo "Reason: $REASON"
- name: Block if assessment fails
if: steps.extract.outputs.content_found == 'true'