Skip to content

Commit

Permalink
Merge pull request #72 from inscripoem/master
Browse files Browse the repository at this point in the history
ci(tools): fix user verify in all article checker
  • Loading branch information
mudongliang committed May 12, 2024
2 parents c931e12 + 8a75cc4 commit 950ed30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/check-all-article.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ jobs:
- name: Generate Report
uses: BaileyJM02/[email protected]
with:
input_path: ./.cache/report.md
output_dir: ./outputs
input_path: ./output/report.md
output_dir: ./output/
build_html: true
build_pdf: true
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: report
path: |
./outputs/*
./.cache/report.md
./output/*
21 changes: 8 additions & 13 deletions .scripts/check_all.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

REPORT_MD=".cache/report.md"
REPORT_MD="output/report.md"

# Get valid files in git diff (markdown files in sources/)
get_diff_article_files() {
Expand All @@ -15,6 +15,7 @@ get_diff_article_files() {

init_cache() {
mkdir -p .cache/users
mkdir -p output
echo "# Check Report" > "$REPORT_MD"
}

Expand Down Expand Up @@ -83,10 +84,8 @@ check_proofreading() {
if [ "$PROOFREADER" == "null" ]; then
update_report "Missing metadata in proofreader; "
else
if [ "$STATUS" == "proofreading" ] || [ "$STATUS" == "proofread" ]; then
if [ $(check_github_user $PROOFREADER) -eq 1 ]; then
update_report "Proofreader is not a valid GitHub user; "
fi
if [ $(check_github_user $PROOFREADER) -eq 1 ]; then
update_report "Proofreader is not a valid GitHub user; "
fi
fi
}
Expand Down Expand Up @@ -114,10 +113,8 @@ check_translating() {
if [ "$TRANSLATOR" == "null" ]; then
update_report "Missing metadata in translator; "
else
if [ "$STATUS" == "translating" ] || [ "$STATUS" == "translated" ]; then
if [ $(check_github_user $TRANSLATOR) -eq 1 ]; then
update_report "Translator is not a valid GitHub user; "
fi
if [ $(check_github_user $TRANSLATOR) -eq 1 ]; then
update_report "Translator is not a valid GitHub user; "
fi
fi
}
Expand All @@ -139,10 +136,8 @@ check_collected() {
if [ ! $TRANSLATED_DATE == "null" ] && [ $TRANSLATED_DATE -lt $COLLECTED_DATE ]; then
update_report "Translated date is earlier than collected date; "
fi
if [ "$STATUS" == "collected" ]; then
if [ $(check_github_user $COLLECTOR) -eq 1 ]; then
update_report "Collector is not a valid GitHub user; "
fi
if [ $(check_github_user $COLLECTOR) -eq 1 ]; then
update_report "Collector is not a valid GitHub user; "
fi
fi
}
Expand Down

0 comments on commit 950ed30

Please sign in to comment.