Skip to content

Commit f40e2d0

Browse files
committed
global variable for token file path
1 parent 22cfd3e commit f40e2d0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/token_consistency.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ jobs:
1010
- name: Checkout code
1111
uses: actions/checkout@v2
1212

13+
- name: Set global variable for tokens.txt path
14+
run: |
15+
TOKENS_FILE_PATH="chebai/preprocessing/bin/smiles_token/tokens.txt"
16+
echo "TOKENS_FILE_PATH=$TOKENS_FILE_PATH" >> $GITHUB_ENV
17+
1318
- name: Get previous tokens.txt version
1419
run: |
1520
git fetch origin dev
16-
git diff origin/dev -- chebai/preprocessing/bin/smiles_token/tokens.txt > tokens_diff.txt || echo "No previous tokens.txt found"
21+
git diff origin/dev -- $TOKENS_FILE_PATH > tokens_diff.txt || echo "No previous tokens.txt found"
1722
1823
- name: Check for deleted or added lines in tokens.txt
1924
run: |
@@ -35,7 +40,7 @@ jobs:
3540
num_added_lines=$(echo "$added_lines" | wc -l)
3641
3742
# Get last `n` lines (equal to num_added_lines) of tokens.tx
38-
last_lines=$(tail -n "$num_added_lines" chebai/preprocessing/bin/smiles_token/tokens.txt)
43+
last_lines=$(tail -n "$num_added_lines" $TOKENS_FILE_PATH)
3944
4045
# Check if the added lines are at the end of the file
4146
if [ "$added_lines" != "$last_lines" ]; then

0 commit comments

Comments
 (0)