Skip to content

Commit

Permalink
Merge pull request #30 from FL33TW00D/feature/bot
Browse files Browse the repository at this point in the history
test
  • Loading branch information
FL33TW00D authored Jan 22, 2024
2 parents 55ded95 + 7ff9d20 commit 715f457
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ratbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

# Step to count lines of code using scc
- name: Count lines of code
id: loc
run: |
cd ./crates/ratchet-core
LINES=$(scc -irs --exclude-file kernels | tail -1 | awk '{print $2}')
echo "::set-output name=lines::$LINES"
- name: Get the lines of code.
id: scc
uses: Adapt-API/scc-docker-action@master
with:
args: ${{ env.workspace }} -irs --exclude-file kernels

# Step to comment on the PR
- name: Comment PR
uses: actions/github-script@v6
with:
script: |
const linesOfCode = ${{ steps.loc.outputs.lines }};
const codeReport = '${{ steps.scc.outputs.scc }}';
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Your PR has ${linesOfCode} lines of code.`
body: `${codeReport`
})

0 comments on commit 715f457

Please sign in to comment.