Skip to content

Commit

Permalink
global variable for token file path
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya0by0 committed Oct 20, 2024
1 parent 22cfd3e commit f40e2d0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/token_consistency.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set global variable for tokens.txt path
run: |
TOKENS_FILE_PATH="chebai/preprocessing/bin/smiles_token/tokens.txt"
echo "TOKENS_FILE_PATH=$TOKENS_FILE_PATH" >> $GITHUB_ENV
- name: Get previous tokens.txt version
run: |
git fetch origin dev
git diff origin/dev -- chebai/preprocessing/bin/smiles_token/tokens.txt > tokens_diff.txt || echo "No previous tokens.txt found"
git diff origin/dev -- $TOKENS_FILE_PATH > tokens_diff.txt || echo "No previous tokens.txt found"
- name: Check for deleted or added lines in tokens.txt
run: |
Expand All @@ -35,7 +40,7 @@ jobs:
num_added_lines=$(echo "$added_lines" | wc -l)
# Get last `n` lines (equal to num_added_lines) of tokens.tx
last_lines=$(tail -n "$num_added_lines" chebai/preprocessing/bin/smiles_token/tokens.txt)
last_lines=$(tail -n "$num_added_lines" $TOKENS_FILE_PATH)
# Check if the added lines are at the end of the file
if [ "$added_lines" != "$last_lines" ]; then
Expand Down

0 comments on commit f40e2d0

Please sign in to comment.