Skip to content

Commit

Permalink
Merge pull request huggingface#199 from officialcjunior/ratbot-use-tokei
Browse files Browse the repository at this point in the history
ratbot workflow: replace `scc` with `tokei`
  • Loading branch information
FL33TW00D authored May 15, 2024
2 parents 34ae2df + 542e3bd commit 2a626e6
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/ratbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Get the lines of code
id: scc
uses: iryanbell/[email protected]
with:
args: ${{ env.workspace }} -irs

- name: Write output to a file
- name: Install Rust and Cargo
run: |
echo "${{ steps.scc.outputs.scc }}" > scc_output.txt
curl -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Install Tokei
run: cargo install tokei

- name: Run Tokei and get the lines of code
run: tokei crates/ratchet-core > tokei_output.txt

- name: Comment or Update PR
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const sccOutput = fs.readFileSync('scc_output.txt', 'utf8');
const tokeiOutput = fs.readFileSync('tokei_output.txt', 'utf8');
const uniqueIdentifier = 'Code Metrics Report';
const codeReport = `
<details>
<summary>${uniqueIdentifier}</summary>
<pre>
${sccOutput}
${tokeiOutput}
</pre>
</details>
`;
Expand Down

0 comments on commit 2a626e6

Please sign in to comment.