Skip to content

Commit

Permalink
infra[patch]: Improve speeds for spam detection script (langchain-ai#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul authored and CarterMorris committed Nov 10, 2024
1 parent 289ec35 commit 3371d5d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/spam-comment-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,27 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Check issue body against regex
id: regex_check
run: |
REGEX='^download\s+(?:https?:\/\/)?[\w-]+(\.[\w-]+)+[^\s]+\s+password:\s*.+\s+in the installer menu, select\s*.+$'
if echo "${{ github.event.comment.body }}" | grep -qiE "$REGEX"; then
echo "REGEX_MATCHED=true" >> $GITHUB_OUTPUT
else
echo "REGEX_MATCHED=false" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
run: yarn install --immutable
if: steps.regex_check.outputs.REGEX_MATCHED == 'true'
run: cd ./libs/langchain-scripts && yarn workspaces focus
- name: Build scripts
run: yarn turbo:command build --filter=@langchain/scripts
if: steps.regex_check.outputs.REGEX_MATCHED == 'true'
run: cd ./libs/langchain-scripts && yarn build:internal
- name: Run spam detection script
if: steps.regex_check.outputs.REGEX_MATCHED == 'true'
env:
SPAM_COMMENT_GITHUB_TOKEN: ${{ secrets.SPAM_COMMENT_GITHUB_TOKEN }}
COMMENT_JSON: ${{ toJson(github.event.comment) }}
COMMENT_ID: ${{ github.event.comment.id }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
run: yarn workspace @langchain/scripts filter_spam_comment
run: cd ./libs/langchain-scripts && yarn filter_spam_comment

0 comments on commit 3371d5d

Please sign in to comment.