Skip to content

Commit 90b4b56

Browse files
author
Adil Wahab Bhatti
authored
Refactor token count workflow by removing unused steps
Removed unused job steps and paths related to token counting.
1 parent dcba5c2 commit 90b4b56

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

.github/workflows/token-count.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,11 @@
11
name: Update token count
22

3-
on:
4-
push:aname: Update token count
5-
63
on:
74
push:
85
paths:
96
- 'instructions.txt'
107
workflow_dispatch:
118

12-
jobs:
13-
count:
14-
runs-on: ubuntu-latest
15-
permissions:
16-
contents: write
17-
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Count tokens
21-
run: |
22-
pip install tiktoken -q
23-
COUNT=$(python3 -c "
24-
import tiktoken
25-
enc = tiktoken.get_encoding('cl100k_base')
26-
print(len(enc.encode(open('instructions.txt').read())))
27-
")
28-
sed -i "s/Tokens-~[0-9]*/Tokens-~$COUNT/" README.md
29-
30-
- name: Commit updated README
31-
run: |
32-
git config user.name "github-actions"
33-
git config user.email "actions@github.com"
34-
git diff --quiet || (git add README.md && git commit -m "Update token count" && git push)
35-
36-
paths:
37-
- "instructions.txt"
38-
399
jobs:
4010
count:
4111
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)