From 92ce0c1d3bece1a304d634d37ba0e00cca38ba91 Mon Sep 17 00:00:00 2001 From: g_it Date: Wed, 8 Apr 2026 16:49:50 +0200 Subject: [PATCH] . --- .forgejo/workflows/resume.yml | 91 +++++++++++++++++------------------ 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/.forgejo/workflows/resume.yml b/.forgejo/workflows/resume.yml index 32a1a62..e5bfc88 100644 --- a/.forgejo/workflows/resume.yml +++ b/.forgejo/workflows/resume.yml @@ -27,63 +27,62 @@ 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\" + }" - echo "Testing Ollama connectivity..." - curl -v http://ollama:11434/api/tags || echo "Ollama unreachable" + echo "Testing Ollama connectivity..." + curl -v http://ollama:11434/api/tags || echo "Ollama unreachable" - 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 - }") + 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 + }") - echo "Raw response:" - echo "$RESPONSE" - echo "---" + echo "Raw response:" + echo "$RESPONSE" + echo "---" - if [ -z "$RESPONSE" ]; then - echo "Error: No response from Ollama" - exit 1 - fi + if [ -z "$RESPONSE" ]; then + echo "Error: No response from Ollama" + exit 1 + fi - RESULT=$(echo "$RESPONSE" | jq -r '.response' 2>/dev/null) + RESULT=$(echo "$RESPONSE" | jq -r '.response' 2>/dev/null) - if [ -z "$RESULT" ] || [ "$RESULT" = "null" ]; then - echo "Error: Could not extract response from Ollama" - echo "Response was: $RESPONSE" - exit 1 - fi - - echo "Ollama response:" - echo "$RESULT" - echo "validation_result=$RESULT" >> $GITHUB_OUTPUT + if [ -z "$RESULT" ] || [ "$RESULT" = "null" ]; then + echo "Error: Could not extract response from Ollama" + echo "Response was: $RESPONSE" + exit 1 + fi + echo "Ollama response:" + echo "$RESULT" + echo "validation_result=$RESULT" >> $GITHUB_OUTPUT - name: Block if assessment fails if: steps.extract.outputs.content_found == 'true'