Update .gitea/workflows/codeant.yml
All checks were successful
Codeant Security Scan / codeant-scan (push) Successful in 41s
All checks were successful
Codeant Security Scan / codeant-scan (push) Successful in 41s
This commit is contained in:
@@ -12,51 +12,54 @@ on:
|
||||
jobs:
|
||||
codeant-scan:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js (Satisfies Engine Requirements)
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '22' # Using Node 22 to avoid EBADENGINE errors
|
||||
- name: Install and Inject Config
|
||||
env:
|
||||
MY_KEY: ${{ secrets.CODEANT_API_TOKEN }}
|
||||
node-version: '22'
|
||||
|
||||
- name: Install CodeAnt CLI
|
||||
run: npm install -g codeant-cli
|
||||
|
||||
- name: Authenticate CodeAnt
|
||||
run: codeant set-token github ${{ secrets.CODEANT_API_TOKEN }}
|
||||
|
||||
- name: Setup Git identity
|
||||
run: |
|
||||
npm install -g codeant-cli
|
||||
mkdir -p $HOME/.codeant
|
||||
echo $MY_KEY
|
||||
# Now we use the environment variable $MY_KEY
|
||||
printf '{"apiKey":"%s"}\n' "$MY_KEY" > $HOME/.codeant/config.json
|
||||
cat $HOME/.codeant/config.json
|
||||
|
||||
# Verify: This should now show ~35-40 bytes
|
||||
echo "Config file size: $(wc -c < $HOME/.codeant/config.json) bytes"
|
||||
|
||||
- name: Force full repo AI scan
|
||||
run: |
|
||||
echo "Preparing full repo scan..."
|
||||
|
||||
git config --global user.email "ci@gitea.local"
|
||||
git config --global user.name "Gitea CI"
|
||||
|
||||
git fetch origin main
|
||||
# 🔥 Full scan only on schedule (recommended)
|
||||
- name: Full repo AI scan (daily)
|
||||
if: github.event_name == 'schedule'
|
||||
run: |
|
||||
echo "Running FULL repo scan..."
|
||||
|
||||
git checkout -b codeant-fullscan
|
||||
git checkout -b codeant-fullscan || git checkout codeant-fullscan
|
||||
|
||||
# 🔥 Modify ALL files (real change, not just timestamp)
|
||||
# Modify all files to force diff
|
||||
find . -type f \
|
||||
-not -path "./.git/*" \
|
||||
-exec sh -c 'echo "" >> "$1"' _ {} \;
|
||||
|
||||
|
||||
git add .
|
||||
git commit -m "full repo scan"
|
||||
git commit -m "full repo scan" || true
|
||||
|
||||
echo "Running CodeAnt AI Review..."
|
||||
codeant review --committed > review.txt || true
|
||||
|
||||
cat review.txt
|
||||
# ⚡ Normal scan (PR / push)
|
||||
- name: Incremental AI scan
|
||||
if: github.event_name != 'schedule'
|
||||
run: |
|
||||
echo "Running incremental scan..."
|
||||
|
||||
codeant review --committed > review.txt || true
|
||||
|
||||
- name: Show results
|
||||
run: cat review.txt
|
||||
Reference in New Issue
Block a user