99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v3
12+ with :
13+ fetch-depth : 0
1214
13- - name : Get changed and removed files (last 2 commits)
15+ - name : Get changed and removed files (last 2 commits on main )
1416 id : files
1517 run : |
16- last2=$(git rev-list --max-count=2 HEAD)
18+ git fetch origin main
19+ last2=$(git rev-list --max-count=2 origin/main)
1720 commit_arr=($last2)
1821 if [ "${#commit_arr[@]}" -eq 2 ]; then
1922 base_commit=${commit_arr[1]}
@@ -22,14 +25,22 @@ jobs:
2225 base_commit=${commit_arr[0]}
2326 head_commit=${commit_arr[0]}
2427 fi
25- echo "Comparing $base_commit..$head_commit"
28+ echo "Comparing $base_commit..$head_commit on main branch "
2629 echo "changed=$(git diff --name-only $base_commit $head_commit -- 'content/**/*.mdx' | xargs)" >> $GITHUB_OUTPUT
2730 echo "removed=$(git diff --name-only --diff-filter=D $base_commit $head_commit -- 'content/**/*.mdx' | xargs)" >> $GITHUB_OUTPUT
2831
32+ - name : Print files being sent to agent
33+ run : |
34+ echo "Changed files: ${{ steps.files.outputs.changed }}"
35+ echo "Removed files: ${{ steps.files.outputs.removed }}"
36+
2937 - name : Trigger Agentuity Sync Agent
3038 run : |
3139 changed_json=$(jq -n --arg files "${{ steps.files.outputs.changed }}" '$files | split(" ") | map(select(length > 0))')
3240 removed_json=$(jq -n --arg files "${{ steps.files.outputs.removed }}" '$files | split(" ") | map(select(length > 0))')
41+ echo "Sending to agent API:"
42+ echo "Changed files JSON: $changed_json"
43+ echo "Removed files JSON: $removed_json"
3344 curl https://agentuity.ai/webhook/f61d5ce9d6ed85695cc992c55ccdc2a6 \
3445 -X POST \
3546 -H "Content-Type: application/json" \
0 commit comments