Add monitoring tool document #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check alioss in Changed Files | |
on: | |
pull_request: | |
branches: | |
- main | |
# allow manually run the action: | |
workflow_dispatch: | |
jobs: | |
img-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check for alioss in changed files | |
run: | | |
# Fetch the target branch | |
git fetch origin $GITHUB_BASE_REF | |
git switch -c check_branch | |
# Get the diff of the changes | |
echo Get the diff of the changes | |
DIFF=$(git diff origin/$GITHUB_BASE_REF check_branch -- . ':(exclude).github/workflows/alioss-check.yml') | |
if [ -z "$DIFF" ]; then | |
echo "No changes detected." | |
exit 0 | |
fi | |
# Check the diff for alioss | |
echo Check the diff for alioss | |
ALIOSS=$(echo "$DIFF" | grep -E '^\+.*(alioss)' | wc -l) | |
echo ALIOSS | |
echo "$DIFF" | grep -E '^\+.*(alioss)' > check.log | |
if [ $(wc -l < check.log> -eq 0)]; then | |
echo "No alioss found in changed content." | |
else | |
echo "alioss found in the changes. Please use upload to src/.vuepress/public/img." | |
cat check.log | |
exit 1 | |
fi |