From f57715bb28b8f4f0a9e50782b16b1925ab901db8 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 29 Jul 2021 14:56:38 +0200 Subject: [PATCH] FIx force-build --- .github/workflows/build_doc.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 7f74eee9a6b..8babc109d02 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -18,13 +18,15 @@ jobs: if(asso == 'OWNER' || asso == 'MEMBER') { const body = context.payload.comment.body if(body.includes("build:")) { - const re = /\/build:(\w+)\s*/; + const re = /\/(force-)?build:(\w+)\s*/; if(re.test(body)){ const res = re.exec(body) if(body.includes("force-")) { - echo "::set-output name=force::yes" + return "res[1]:yes"; + } + else{ + return "res[1]:no"; } - return res[1]; } } } @@ -73,7 +75,9 @@ jobs: run: | set -ex PR_NUMBER=${{ steps.get_pr_number.outputs.result }} - ROUND=${{ steps.get_round.outputs.result }} + TMP_ROUND=${{ steps.get_round.outputs.result }} + ROUND=$(echo $TMP_ROUND | cut -d ":" -f 1) + force=$(echo $TMP_ROUND | cut -d ":" -f 2) wget --no-verbose cgal.github.io -O tmp.html const force = "${{steps.get_round.outputs.force}}" if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html || [ "$force" = "yes" ]; then @@ -106,7 +110,7 @@ jobs: mv tmp.html index.html git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master else - echo "::set-output name=DoxygenError::This round already exists." + echo "::set-output name=DoxygenError::This round already exists. Overwrite it with `/build-force`" exit 1 fi