From 6d02a198355c33bd90be44f9d9609f01efe8d241 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 08:01:57 +0100 Subject: [PATCH 01/32] Run on pull requests --- .github/workflows/call-deploy-book.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/call-deploy-book.yml b/.github/workflows/call-deploy-book.yml index 2cdfefd..6ad6430 100644 --- a/.github/workflows/call-deploy-book.yml +++ b/.github/workflows/call-deploy-book.yml @@ -12,6 +12,13 @@ on: - book/** - requirements.txt - .github/workflows/call-deploy-book.yml + pull_request: + branches: + - '**' + paths: + - book/** + - requirements.txt + - .github/workflows/call-deploy-book.yml workflow_dispatch: jobs: From 960b7e9e8fb1637dca649f9d55e4a2e39799714d Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 08:15:48 +0100 Subject: [PATCH 02/32] Includes 'branches' from pull requests --- .github/workflows/deploy-book.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 8c998be..53fab79 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -77,7 +77,11 @@ jobs: else branches=$(echo "$BRANCHES_TO_DEPLOY" | tr ' ' '\n' | grep -E '\S') fi - + + # Fetch all open pull requests and include their branches + pr_branches=$(gh pr list --state open --json headRefName --jq '.[].headRefName') + branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') + # Record branch names (one per line) for alias validation echo "$branches" | tr ' ' '\n' > branches.txt From 6af6398fb9bd59ee309b51cada57e918cbd04251 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 08:19:07 +0100 Subject: [PATCH 03/32] only include pull requests from forks --- .github/workflows/deploy-book.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 53fab79..a6eea94 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -78,8 +78,8 @@ jobs: branches=$(echo "$BRANCHES_TO_DEPLOY" | tr ' ' '\n' | grep -E '\S') fi - # Fetch all open pull requests and include their branches - pr_branches=$(gh pr list --state open --json headRefName --jq '.[].headRefName') + # Fetch all open pull requests from forks and include their branches + pr_branches=$(gh pr list --state open --json headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | .headRefName') branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') # Record branch names (one per line) for alias validation From a5bcfc161fbd56e84c73b93eac708f2e9c49b8f8 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 08:24:48 +0100 Subject: [PATCH 04/32] Correct reference format for checkout The gh pr list command now fetches the pull request number and constructs the correct reference format (refs/pull/{pull_number}/merge) for each pull request branch. --- .github/workflows/deploy-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index a6eea94..b13eecf 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -79,7 +79,7 @@ jobs: fi # Fetch all open pull requests from forks and include their branches - pr_branches=$(gh pr list --state open --json headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | .headRefName') + pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') # Record branch names (one per line) for alias validation From 94d22e89dc3eefe78ec6420fa168261d9ecc6d21 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 08:26:49 +0100 Subject: [PATCH 05/32] debug --- .github/workflows/deploy-book.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index b13eecf..8381b66 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -80,6 +80,11 @@ jobs: # Fetch all open pull requests from forks and include their branches pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + + # Print the pull request branches for debugging + echo "Pull request branches:" + echo "$pr_branches" + branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') # Record branch names (one per line) for alias validation From 3bdd4f70d5868f6c5766d996addfdd0ef286404d Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 08:27:54 +0100 Subject: [PATCH 06/32] Revert "debug" This reverts commit 94d22e89dc3eefe78ec6420fa168261d9ecc6d21. --- .github/workflows/deploy-book.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 8381b66..b13eecf 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -80,11 +80,6 @@ jobs: # Fetch all open pull requests from forks and include their branches pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') - - # Print the pull request branches for debugging - echo "Pull request branches:" - echo "$pr_branches" - branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') # Record branch names (one per line) for alias validation From 39ac60034ff6d5e02815e5d5a476b01ec3e2c2b2 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:05:30 +0100 Subject: [PATCH 07/32] clean branch name for PR --- .github/workflows/deploy-book.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index b13eecf..86f5c30 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -272,7 +272,12 @@ jobs: - name: Clean branch name of disallowed characters if: always() run: | - echo "MATRIX_BRANCH_NAME_CLEAN=$(echo ${{ matrix.branch }} | tr '/":<>|*?\/\\' '-')" >> $GITHUB_ENV + if [[ "${{ matrix.branch }}" =~ refs/pull/([0-9]+)/merge ]]; then + CLEAN_BRANCH_NAME="PR-${BASH_REMATCH[1]}" + else + CLEAN_BRANCH_NAME=$(echo "${{ matrix.branch }}" | tr '/":<>|*?\\' '-') + fi + echo "MATRIX_BRANCH_NAME_CLEAN=${CLEAN_BRANCH_NAME}" >> $GITHUB_ENV - name: Upload summary as an artifact if: always() From 525f21232041cb2aa36f03ad61790667fc7c08f0 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:25:15 +0100 Subject: [PATCH 08/32] Clean name for summary too --- .github/workflows/deploy-book.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 86f5c30..c85ffe9 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -371,10 +371,19 @@ jobs: # https://stackoverflow.com/a/76354104 url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url') - # Clean branch names - cat raw.txt | tr '/":<>|*?\/\\' '-' > clean.txt + # Clean normal branch names + grep -v '^refs/pull/' raw.txt | tr '/":<>|*?\\' '-' > clean.txt + + # Include cleaned PR branches + grep '^refs/pull/' raw.txt | sed 's|refs/pull/\([0-9]\+\)/merge|PR-\1|' >> clean.txt + + # Generate status.txt cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt + + # Combine raw, clean, and status into pasted.txt paste -d ';' raw.txt clean.txt status.txt > pasted.txt + + # Generate summary.md cat pasted.txt | while IFS=';' read -r raw clean status; do echo "| $raw | <$url$clean> | $status |" >> summary.md From 73fe456d0c4ae9d2a97d41f226479166b6c3437c Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:30:18 +0100 Subject: [PATCH 09/32] add repository variable pull requests to deploy --- .github/workflows/deploy-book.yml | 12 +++++++++++- README.md | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index c85ffe9..91f6dc2 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -41,6 +41,11 @@ env: # Space-separated list of branch names, e.g. 'main second third'. # By default, deploy all branches. This is indicated by '*'. BRANCHES_TO_DEPLOY: ${{ vars.BRANCHES_TO_DEPLOY != '' && vars.BRANCHES_TO_DEPLOY || '*' }} + + # Which pull requests to release + # Space-separated list of pull request numbers, e.g. '1 2 3'. + # By default, deploy all pull requests. This is indicated by '*'. + PULL_REQUESTS_TO_DEPLOY: ${{ vars.PULL_REQUESTS_TO_DEPLOY != '' && vars.PULL_REQUESTS_TO_DEPLOY || '*' }} # Preprocessing is described here: (as described here: https://teachbooks.github.io/TeachBooks/cli/cli.html#teachbooks-build) # Space-separated list of branch names, e.g. 'main second third'. @@ -79,7 +84,12 @@ jobs: fi # Fetch all open pull requests from forks and include their branches - pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + if [ "$PULL_REQUESTS_TO_DEPLOY" == '*' ]; then + pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + else + pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + fi + branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') # Record branch names (one per line) for alias validation diff --git a/README.md b/README.md index b698caa..9561029 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,9 @@ You can adapt the behaviour by setting repository variables as explained [here]( - `BRANCHES_TO_DEPLOY` which is set to `*` (all branches) whenever it's not defined in the repository variables. - This defines the branches to deploy. - It should be a space-separated list of branch names, e.g. 'main second third'. +- `PULL_REQUESTS_TO_DEPLOY` which is set to `*` (all branches) whenver it's not defined in the repository ariables. + - This defines the pull requests to deploy + - It should be a space-seperated list of pull request numbers, e.g. '1 2 3' - `BRANCHES_TO_PREPROCESS` which is to to ` ` (just a space = no branch) whenever it's not defined in the repository variables - This defines the branches to preprocess with the [`TeachBooks` package](https://teachbooks.io/TeachBooks/cli/cli.html#cmdoption-teachbooks-build), which removed book-pages and config lines defined with `# START REMOVE FROM RELEASE` and `# END REMOVE FROM RELEASE` - It should be a space-separated list of branch names, e.g. 'main second third'. From a38a855a1946a6d2cd2de21bff479b9b4afe35c4 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:34:45 +0100 Subject: [PATCH 10/32] Allow for no pull requests --- .github/workflows/deploy-book.yml | 3 +++ README.md | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 91f6dc2..bdc81a8 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -45,6 +45,7 @@ env: # Which pull requests to release # Space-separated list of pull request numbers, e.g. '1 2 3'. # By default, deploy all pull requests. This is indicated by '*'. + # If building of pull request is unwanted, PULL_REQUESTS_TO_DEPLOY may be set to ' ' (space). PULL_REQUESTS_TO_DEPLOY: ${{ vars.PULL_REQUESTS_TO_DEPLOY != '' && vars.PULL_REQUESTS_TO_DEPLOY || '*' }} # Preprocessing is described here: (as described here: https://teachbooks.github.io/TeachBooks/cli/cli.html#teachbooks-build) @@ -86,6 +87,8 @@ jobs: # Fetch all open pull requests from forks and include their branches if [ "$PULL_REQUESTS_TO_DEPLOY" == '*' ]; then pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + elif [ "$PULL_REQUESTS_TO_DEPLOY" == ' ' ]; then + pr_branches="" else pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') fi diff --git a/README.md b/README.md index 9561029..2ac28d0 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ You can adapt the behaviour by setting repository variables as explained [here]( - `PULL_REQUESTS_TO_DEPLOY` which is set to `*` (all branches) whenver it's not defined in the repository ariables. - This defines the pull requests to deploy - It should be a space-seperated list of pull request numbers, e.g. '1 2 3' + - If building of pull request is unwanted, PULL_REQUESTS_TO_DEPLOY may be set to ' ' (space). - `BRANCHES_TO_PREPROCESS` which is to to ` ` (just a space = no branch) whenever it's not defined in the repository variables - This defines the branches to preprocess with the [`TeachBooks` package](https://teachbooks.io/TeachBooks/cli/cli.html#cmdoption-teachbooks-build), which removed book-pages and config lines defined with `# START REMOVE FROM RELEASE` and `# END REMOVE FROM RELEASE` - It should be a space-separated list of branch names, e.g. 'main second third'. From eb01e607a34bbe04f97ab41b22b6face1e7f7c28 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:41:30 +0100 Subject: [PATCH 11/32] debug --- .github/workflows/deploy-book.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index bdc81a8..3b941f3 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -93,8 +93,16 @@ jobs: pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') fi + # Print the pull request branches for debugging + echo "Pull request branches (raw):" + echo "$pr_branches" + branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') + # Print the combined branches for debugging + echo "Combined branches:" + echo "$branches" + # Record branch names (one per line) for alias validation echo "$branches" | tr ' ' '\n' > branches.txt From 2b76ef1537a5cce51b3d19eebb056d401de42f17 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:46:19 +0100 Subject: [PATCH 12/32] fix issue of double hits when syncing pull requests --- .github/workflows/deploy-book.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 3b941f3..81ecce3 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -86,11 +86,12 @@ jobs: # Fetch all open pull requests from forks and include their branches if [ "$PULL_REQUESTS_TO_DEPLOY" == '*' ]; then - pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq 'unique_by(.number) | .[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') elif [ "$PULL_REQUESTS_TO_DEPLOY" == ' ' ]; then pr_branches="" else - pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'unique_by(.number) | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + fi # Print the pull request branches for debugging From c9c94ac6421fa506287b663751cec45d23bb88f8 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:52:09 +0100 Subject: [PATCH 13/32] Revert "fix issue of double hits when syncing pull requests" This reverts commit 2b76ef1537a5cce51b3d19eebb056d401de42f17. --- .github/workflows/deploy-book.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 81ecce3..3b941f3 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -86,12 +86,11 @@ jobs: # Fetch all open pull requests from forks and include their branches if [ "$PULL_REQUESTS_TO_DEPLOY" == '*' ]; then - pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq 'unique_by(.number) | .[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') + pr_branches=$(gh pr list --state open --json number,headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') elif [ "$PULL_REQUESTS_TO_DEPLOY" == ' ' ]; then pr_branches="" else - pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'unique_by(.number) | select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') - + pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') fi # Print the pull request branches for debugging From 4fe2eda7c2a842da1bbe31cd072efc0fab94bc09 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:53:00 +0100 Subject: [PATCH 14/32] Trimming leading/trailing spaces and remove duplicates --- .github/workflows/deploy-book.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 3b941f3..406e319 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -97,7 +97,9 @@ jobs: echo "Pull request branches (raw):" echo "$pr_branches" - branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') + # Combine branches and pr_branches, trimming any leading/trailing spaces and removing duplicates + branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sort | uniq) + # Print the combined branches for debugging echo "Combined branches:" From 9c6192c84c7bb153a15f83e8c8e4bf3cdbb5f521 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:55:26 +0100 Subject: [PATCH 15/32] more debug --- .github/workflows/deploy-book.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 406e319..801d8af 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -83,6 +83,10 @@ jobs: else branches=$(echo "$BRANCHES_TO_DEPLOY" | tr ' ' '\n' | grep -E '\S') fi + + # Print the branches for debugging + echo "branches (raw):" + echo "$branches" # Fetch all open pull requests from forks and include their branches if [ "$PULL_REQUESTS_TO_DEPLOY" == '*' ]; then From 935b7a961498dc7e595b6c940763f655d8209084 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:59:13 +0100 Subject: [PATCH 16/32] filter PR to emerge in branch step --- .github/workflows/deploy-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 801d8af..6210e07 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -79,7 +79,7 @@ jobs: # If all (*), query all remote branches # If not, read from env var if [ "$BRANCHES_TO_DEPLOY" == '*' ]; then - branches=$(git branch -r | sed 's,\s*origin/,,g' | grep -v '\->') + branches=$(git branch -r | sed 's,\s*origin/,,g' | grep -v '\->' | grep -v 'pull/') else branches=$(echo "$BRANCHES_TO_DEPLOY" | tr ' ' '\n' | grep -E '\S') fi From 81faf4a620a2c0645ad9eab465219ce05d86c237 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 09:59:21 +0100 Subject: [PATCH 17/32] Revert "Trimming leading/trailing spaces and remove duplicates" This reverts commit 4fe2eda7c2a842da1bbe31cd072efc0fab94bc09. --- .github/workflows/deploy-book.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 6210e07..7831097 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -101,9 +101,7 @@ jobs: echo "Pull request branches (raw):" echo "$pr_branches" - # Combine branches and pr_branches, trimming any leading/trailing spaces and removing duplicates - branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sort | uniq) - + branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') # Print the combined branches for debugging echo "Combined branches:" From d235c56b381c330e34e385d545b4f9f2d3b45df6 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 10:01:14 +0100 Subject: [PATCH 18/32] Revert "debug" This reverts commit eb01e607a34bbe04f97ab41b22b6face1e7f7c28. --- .github/workflows/deploy-book.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 7831097..50233fe 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -97,16 +97,8 @@ jobs: pr_branches=$(echo "$PULL_REQUESTS_TO_DEPLOY" | tr ' ' '\n' | xargs -I {} gh pr view {} --json number,headRefName,isCrossRepository --jq 'select(.isCrossRepository) | "refs/pull/" + (.number|tostring) + "/merge"') fi - # Print the pull request branches for debugging - echo "Pull request branches (raw):" - echo "$pr_branches" - branches=$(echo -e "$branches\n$pr_branches" | grep -E '\S') - # Print the combined branches for debugging - echo "Combined branches:" - echo "$branches" - # Record branch names (one per line) for alias validation echo "$branches" | tr ' ' '\n' > branches.txt From 9e65fab561a441070e29be48b8e87cc63a48a25d Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 10:01:17 +0100 Subject: [PATCH 19/32] Revert "more debug" This reverts commit 9c6192c84c7bb153a15f83e8c8e4bf3cdbb5f521. --- .github/workflows/deploy-book.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 50233fe..aa93b11 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -83,10 +83,6 @@ jobs: else branches=$(echo "$BRANCHES_TO_DEPLOY" | tr ' ' '\n' | grep -E '\S') fi - - # Print the branches for debugging - echo "branches (raw):" - echo "$branches" # Fetch all open pull requests from forks and include their branches if [ "$PULL_REQUESTS_TO_DEPLOY" == '*' ]; then From 3908cdd186bfef9c3f4897973fe46868bad3acdc Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:28:20 +0100 Subject: [PATCH 20/32] Do not publish PR branch --- .github/workflows/deploy-book.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index aa93b11..f14e82c 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -307,7 +307,7 @@ jobs: path: "buildstatus.txt" - name: Upload the built book HTML as an artifact - if: always() + if: ${{ github.event.pull_request.head.repo.full_name == github.repository && startsWith(matrix.branch, 'refs/pull/') }} uses: actions/upload-artifact@v4 with: name: ${{ env.MATRIX_BRANCH_NAME_CLEAN }} @@ -391,7 +391,11 @@ jobs: grep '^refs/pull/' raw.txt | sed 's|refs/pull/\([0-9]\+\)/merge|PR-\1|' >> clean.txt # Generate status.txt - cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt + if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then + cat clean.txt | xargs -I{} echo "not deployed because of fork" > status.txt + else + cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt + fit # Combine raw, clean, and status into pasted.txt paste -d ';' raw.txt clean.txt status.txt > pasted.txt @@ -410,6 +414,8 @@ jobs: echo ":white_check_mark: \\\`Released\\\` - build success, new version released." echo ":red_circle: \\\`Build failed [1]\\\` - build failure, previous version of the book reused." echo ":o: \\\`Build failed [2]\\\` - build failure, no previous version reused." + echo ":no_entry_sign: \\\`Not deployed because of fork\\\` - deployment skipped for forked repository." + echo echo '#### Primary book at root' From 73ebcd78c0da3cc8b19cdec9bf14625451a91895 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:32:12 +0100 Subject: [PATCH 21/32] typo --- .github/workflows/deploy-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index f14e82c..530355c 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -395,7 +395,7 @@ jobs: cat clean.txt | xargs -I{} echo "not deployed because of fork" > status.txt else cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt - fit + fi # Combine raw, clean, and status into pasted.txt paste -d ';' raw.txt clean.txt status.txt > pasted.txt From 9bbe7fd9e195b67dc8876867e6168755f346fcf8 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:38:06 +0100 Subject: [PATCH 22/32] now also do not update github pages --- .github/workflows/deploy-book.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 530355c..69b0f9d 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -307,7 +307,7 @@ jobs: path: "buildstatus.txt" - name: Upload the built book HTML as an artifact - if: ${{ github.event.pull_request.head.repo.full_name == github.repository && startsWith(matrix.branch, 'refs/pull/') }} + if: always() uses: actions/upload-artifact@v4 with: name: ${{ env.MATRIX_BRANCH_NAME_CLEAN }} @@ -392,7 +392,7 @@ jobs: # Generate status.txt if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then - cat clean.txt | xargs -I{} echo "not deployed because of fork" > status.txt + cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not deployed because of fork\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" > status.txt' else cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt fi @@ -510,11 +510,13 @@ jobs: echo "$HTML_TEMPLATE_404_REDIRECT" | envsubst | tee final/404.html - name: Upload final Pages artifact + if: github.event.pull_request.head.repo.full_name == github.repository uses: actions/upload-pages-artifact@v3 with: path: "final/" - name: Deploy to GitHub Pages + if: github.event.pull_request.head.repo.full_name == github.repository id: deployment uses: actions/deploy-pages@v4 From 58a112c1d708f91768831d2384680a295173ab25 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:46:30 +0100 Subject: [PATCH 23/32] clarified --- .github/workflows/deploy-book.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 69b0f9d..77816b3 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -392,7 +392,7 @@ jobs: # Generate status.txt if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then - cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not deployed because of fork\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" > status.txt' + cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not updated\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" > status.txt' else cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt fi @@ -414,7 +414,7 @@ jobs: echo ":white_check_mark: \\\`Released\\\` - build success, new version released." echo ":red_circle: \\\`Build failed [1]\\\` - build failure, previous version of the book reused." echo ":o: \\\`Build failed [2]\\\` - build failure, no previous version reused." - echo ":no_entry_sign: \\\`Not deployed because of fork\\\` - deployment skipped for forked repository." + echo ":no_entry_sign: \\\`Not updated\\\` - deployment skipped because triggered from forked repository." echo From 89e3cec297bc79b9b2929ea00f53e0a389d54702 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:46:35 +0100 Subject: [PATCH 24/32] debug --- .github/workflows/deploy-book.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 77816b3..84ea07f 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -397,6 +397,8 @@ jobs: cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt fi + cat status.txt + # Combine raw, clean, and status into pasted.txt paste -d ';' raw.txt clean.txt status.txt > pasted.txt From 7026ab761496e6313569132dd8e991897823ecb1 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:55:45 +0100 Subject: [PATCH 25/32] clarified --- .github/workflows/deploy-book.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 84ea07f..4eccb32 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -265,7 +265,7 @@ jobs: - name: Record build success if: success() run: | - echo ":white_check_mark: \\\`Released\\\`" >> buildstatus.txt + echo ":white_check_mark: \\\`Build succes\\\`" >> buildstatus.txt - name: Make summary of errors, if any # run even in case of failure @@ -413,7 +413,7 @@ jobs: { echo echo "#### Legend for build status" - echo ":white_check_mark: \\\`Released\\\` - build success, new version released." + echo ":white_check_mark: \\\`Build success\\\` - build success." echo ":red_circle: \\\`Build failed [1]\\\` - build failure, previous version of the book reused." echo ":o: \\\`Build failed [2]\\\` - build failure, no previous version reused." echo ":no_entry_sign: \\\`Not updated\\\` - deployment skipped because triggered from forked repository." From ef3269e01f8b01af4e65b6cb03245673864b5d3d Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:55:54 +0100 Subject: [PATCH 26/32] fix? --- .github/workflows/deploy-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 4eccb32..9f76461 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -392,7 +392,7 @@ jobs: # Generate status.txt if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then - cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not updated\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" > status.txt' + cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not updated\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" >> status.txt' else cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt fi From e18865992ded758f2f7d95c2ec5cbc1783e369eb Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 13:56:02 +0100 Subject: [PATCH 27/32] Revert "debug" This reverts commit 89e3cec297bc79b9b2929ea00f53e0a389d54702. --- .github/workflows/deploy-book.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 9f76461..218622a 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -397,8 +397,6 @@ jobs: cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt fi - cat status.txt - # Combine raw, clean, and status into pasted.txt paste -d ';' raw.txt clean.txt status.txt > pasted.txt From f037df1fd3872dbae1679a55c0efbd70ee2a8338 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 14:12:08 +0100 Subject: [PATCH 28/32] better if statement --- .github/workflows/deploy-book.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 218622a..cebdf9e 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -391,7 +391,7 @@ jobs: grep '^refs/pull/' raw.txt | sed 's|refs/pull/\([0-9]\+\)/merge|PR-\1|' >> clean.txt # Generate status.txt - if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then + if [[ "${{ github.event_name }}" == 'push' || "${{ github.event_name }}" == 'workflow_dispatch' ]]; then cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not updated\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" >> status.txt' else cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt @@ -510,13 +510,13 @@ jobs: echo "$HTML_TEMPLATE_404_REDIRECT" | envsubst | tee final/404.html - name: Upload final Pages artifact - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' uses: actions/upload-pages-artifact@v3 with: path: "final/" - name: Deploy to GitHub Pages - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' id: deployment uses: actions/deploy-pages@v4 From 1688081c8946ed6162e1f9047ad26ff8d84d725e Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 14:12:16 +0100 Subject: [PATCH 29/32] clarified readme --- .github/workflows/deploy-book.yml | 2 +- README.md | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index cebdf9e..b463cd2 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -411,7 +411,7 @@ jobs: { echo echo "#### Legend for build status" - echo ":white_check_mark: \\\`Build success\\\` - build success." + echo ":white_check_mark: \\\`Build success\\\` - build success, new version used." echo ":red_circle: \\\`Build failed [1]\\\` - build failure, previous version of the book reused." echo ":o: \\\`Build failed [2]\\\` - build failure, no previous version reused." echo ":no_entry_sign: \\\`Not updated\\\` - deployment skipped because triggered from forked repository." diff --git a/README.md b/README.md index 2ac28d0..a2b2031 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The workflow has the following features: - Ability to release both private (GitHub Pro, GitHub Team, GitHub Enterprise Cloud, or GitHub Enterprise Server required) and public (GitHub Free is enough) repositories. GitHub Teams is free for teachers as described in the [GitHub documentation](https://docs.github.com/en/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-education-for-teachers/about-github-education-for-teachers#github-education-features-for-teachers). If you have an organization for your TeachBook on GitHub, link your GitHub team rights to your organization as described on the [GitHub website](https://github.com/team#organizations). -- Releasing all or a selection of branches, allowing to build a draft version of the TeachBook online which reduces the need for local builds of the book +- Releasing all or a selection of branches and pull requests, allowing to build a draft version of the TeachBook online which reduces the need for local builds of the book - Provides a summary describing where the TeachBook is released, errors in the build process per branch and how the release step is configured - Caching of already built books so that it can be partially reused when another branch is released or the next build contains critical errors - Caching of python environment to speed up the workflow @@ -74,24 +74,26 @@ Here's an example for a summary for the template book: > ### Branches deployed > | Branch 🎋 | Link 🔗 | Build status ☑️ | > | :--- | :--- | :--- | -> | main | [https://teachbooks.github.io/template/main](https://teachbooks.github.io/template/main) | ✅ `Released` | +> | main | [https://teachbooks.github.io/template/main](https://teachbooks.github.io/template/main) | ✅ `Build successful` | > | version2 | [https://teachbooks.github.io/template/version2](https://teachbooks.github.io/template/version2) | 🔴 `Build failed [1]` | > | version3 | [https://teachbooks.github.io/template/version3](https://teachbooks.github.io/template/version3) | ⭕ `Build failed [2]` | > > #### Legend for build status -> ✅ `Released` - build success, new version released. +> ✅ `Build successful` - build success, new version used. > > 🔴 `Build failed [1]` - build failure, previous version of the book reused. > > ⭕ `Build failed [2]` - build failure, no previous version reused. > +> 🚫 `Not updated` - deployment skipped because triggered from forked repository. +> > #### Primary book at root -> The book at the website root redirects to the primary branch `main` (status: ✅ `Released`). +> The book at the website root redirects to the primary branch `main` (status: ✅ `Build successful`). > > ### Aliases > | Alias ➡️ | Target 🎯 | Link 🔗 | Build status ☑️ | > | :--- | :--- | :--- | :---- | -> | draft | main | [https://teachbooks.github.io/template/draft](https://teachbooks.github.io/template/draft) | ✅ `Released` | +> | draft | main | [https://teachbooks.github.io/template/draft](https://teachbooks.github.io/template/draft) | ✅ `Build successful` | > > ### Preview of build errors & warnings > For more details please see the corresponding `build-books` jobs in the left pane. From da3c7e261ec7337d4cdf10e93316fb73e1351bda Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 14:19:20 +0100 Subject: [PATCH 30/32] NOT --- .github/workflows/deploy-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index b463cd2..0c9f755 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -391,7 +391,7 @@ jobs: grep '^refs/pull/' raw.txt | sed 's|refs/pull/\([0-9]\+\)/merge|PR-\1|' >> clean.txt # Generate status.txt - if [[ "${{ github.event_name }}" == 'push' || "${{ github.event_name }}" == 'workflow_dispatch' ]]; then + if [[ "${{ github.event_name }}" != 'push' || "${{ github.event_name }}" != 'workflow_dispatch' ]]; then cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not updated\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" >> status.txt' else cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt From 457a9a26e231f7f8c195f42391caf62677c73d10 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 14:26:10 +0100 Subject: [PATCH 31/32] or --> and --- .github/workflows/deploy-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 0c9f755..1bcc381 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -391,7 +391,7 @@ jobs: grep '^refs/pull/' raw.txt | sed 's|refs/pull/\([0-9]\+\)/merge|PR-\1|' >> clean.txt # Generate status.txt - if [[ "${{ github.event_name }}" != 'push' || "${{ github.event_name }}" != 'workflow_dispatch' ]]; then + if [[ "${{ github.event_name }}" != 'push' && "${{ github.event_name }}" != 'workflow_dispatch' ]]; then cat clean.txt | xargs -I{} sh -c 'echo ":no_entry_sign: \\\`Not updated\\\` $(cat _buildstatus/_buildstatus-{}/buildstatus.txt)" >> status.txt' else cat clean.txt | xargs -I{} cat _buildstatus/_buildstatus-{}/buildstatus.txt > status.txt From f3a5374886e5155f28656af8d91d5111185d8aca Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 23 Jan 2025 14:30:44 +0100 Subject: [PATCH 32/32] cleaning --- .github/workflows/deploy-book.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 1bcc381..8a96d71 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -265,7 +265,7 @@ jobs: - name: Record build success if: success() run: | - echo ":white_check_mark: \\\`Build succes\\\`" >> buildstatus.txt + echo ":white_check_mark: \\\`Build successful\\\`" >> buildstatus.txt - name: Make summary of errors, if any # run even in case of failure @@ -411,10 +411,10 @@ jobs: { echo echo "#### Legend for build status" - echo ":white_check_mark: \\\`Build success\\\` - build success, new version used." - echo ":red_circle: \\\`Build failed [1]\\\` - build failure, previous version of the book reused." - echo ":o: \\\`Build failed [2]\\\` - build failure, no previous version reused." - echo ":no_entry_sign: \\\`Not updated\\\` - deployment skipped because triggered from forked repository." + echo ":white_check_mark: \\\`Build successful\\\` - build is successful, new version used." + echo ":red_circle: \\\`Build failed [1]\\\` - build has failed, previous version of the book reused." + echo ":o: \\\`Build failed [2]\\\` - build has failed, no previous version reused." + echo ":no_entry_sign: \\\`Not updated\\\` - deployment is skipped because it's triggered from a forked repository." echo