From f40e2d0f6dde8e0414b3a40e36f4cb8a264de992 Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Sun, 20 Oct 2024 17:22:44 +0200 Subject: [PATCH] global variable for token file path --- .github/workflows/token_consistency.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/token_consistency.yaml b/.github/workflows/token_consistency.yaml index 58b12a3c..727305f6 100644 --- a/.github/workflows/token_consistency.yaml +++ b/.github/workflows/token_consistency.yaml @@ -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: | @@ -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