test #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ratbot | |
on: | |
pull_request_target | |
jobs: | |
comment: | |
runs-on: ubuntu-latest | |
steps: | |
# Step to checkout the repository code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install scc | |
run: | | |
sudo snap install scc | |
- name: Count lines of code | |
id: loc | |
run: | | |
cd ./crates/ratchet-core | |
LINES=$(scc -irs --exclude-file kernel) | |
echo "::set-output name=lines::$LINES" | |
# Step to comment on the PR | |
- name: Comment PR | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const codeReport = '${{ steps.loc.outputs.lines }}'; | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `${codeReport` | |
}) | |