diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fa9e0e9..44e34ea 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - token: ${{ secrets.PAT_TOKEN }} # Use PAT instead of GITHUB_TOKEN + token: ${{ secrets.PAT_TOKEN }} fetch-depth: 0 ref: ${{ github.head_ref || github.ref }} @@ -32,11 +32,21 @@ jobs: git config --global --add safe.directory $PWD git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + + # Set up authentication + git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}.git + + # Run formatting pre-commit run --all-files || true + + # Only push if there are actual changes if ! git diff --quiet; then git add -A git commit -m "style: auto-format code with clang-format [skip ci]" git push + echo "✓ Code formatted and pushed" + else + echo "✓ No formatting changes needed" fi - name: Build C code diff --git a/src/app/index.c b/src/app/index.c index 531883f..30c6408 100644 --- a/src/app/index.c +++ b/src/app/index.c @@ -6,7 +6,14 @@ Index(ResponseWriter* w, Request* r) SetStatus(w, 200, "OK"); SetHeader(w, "Content-Type", "text/html"); char buffer[300]; - snprintf(buffer, 300, "
Request path: %s
Request path: " + "%s