diff --git a/.github/workflows/build_master.yml b/.github/workflows/build_master.yml index 4fc4ace84..f936d8a88 100644 --- a/.github/workflows/build_master.yml +++ b/.github/workflows/build_master.yml @@ -50,7 +50,7 @@ jobs: # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Cat hacktricks-preprocessor.log #- name: Cat hacktricks-preprocessor.log diff --git a/.github/workflows/translate_af.yml b/.github/workflows/translate_af.yml index 19c3044fb..da1c8d92a 100644 --- a/.github/workflows/translate_af.yml +++ b/.github/workflows/translate_af.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_de.yml b/.github/workflows/translate_de.yml index 06fcb57b4..93b3a4ad8 100644 --- a/.github/workflows/translate_de.yml +++ b/.github/workflows/translate_de.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_el.yml b/.github/workflows/translate_el.yml index 08ce93811..2a97877e4 100644 --- a/.github/workflows/translate_el.yml +++ b/.github/workflows/translate_el.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_es.yml b/.github/workflows/translate_es.yml index 384ee3178..fe9a6bfc9 100644 --- a/.github/workflows/translate_es.yml +++ b/.github/workflows/translate_es.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_fr.yml b/.github/workflows/translate_fr.yml index 9d0ab4a10..9f28308e8 100644 --- a/.github/workflows/translate_fr.yml +++ b/.github/workflows/translate_fr.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_hi.yml b/.github/workflows/translate_hi.yml index bd989303f..9e567a8fa 100644 --- a/.github/workflows/translate_hi.yml +++ b/.github/workflows/translate_hi.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_it.yml b/.github/workflows/translate_it.yml index 9073745bd..94c244feb 100644 --- a/.github/workflows/translate_it.yml +++ b/.github/workflows/translate_it.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_ja.yml b/.github/workflows/translate_ja.yml index 84e487fb8..25c9e96f2 100644 --- a/.github/workflows/translate_ja.yml +++ b/.github/workflows/translate_ja.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_ko.yml b/.github/workflows/translate_ko.yml index d83fd3785..9b42c7ecc 100644 --- a/.github/workflows/translate_ko.yml +++ b/.github/workflows/translate_ko.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_pl.yml b/.github/workflows/translate_pl.yml index 8834cfca7..1af70c170 100644 --- a/.github/workflows/translate_pl.yml +++ b/.github/workflows/translate_pl.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_pt.yml b/.github/workflows/translate_pt.yml index 78f454f36..7472a35fa 100644 --- a/.github/workflows/translate_pt.yml +++ b/.github/workflows/translate_pt.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_sr.yml b/.github/workflows/translate_sr.yml index 1ba533556..5085afea5 100644 --- a/.github/workflows/translate_sr.yml +++ b/.github/workflows/translate_sr.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_sw.yml b/.github/workflows/translate_sw.yml index e1459dca1..6f27b4876 100644 --- a/.github/workflows/translate_sw.yml +++ b/.github/workflows/translate_sw.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_tr.yml b/.github/workflows/translate_tr.yml index 45f8a5449..12c2972fc 100644 --- a/.github/workflows/translate_tr.yml +++ b/.github/workflows/translate_tr.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_uk.yml b/.github/workflows/translate_uk.yml index d9decd685..8f1a1d9e7 100644 --- a/.github/workflows/translate_uk.yml +++ b/.github/workflows/translate_uk.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_zh.yml b/.github/workflows/translate_zh.yml index 9d0cc05aa..725fff02e 100644 --- a/.github/workflows/translate_zh.yml +++ b/.github/workflows/translate_zh.yml @@ -61,16 +61,9 @@ jobs: done python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - name: Commit and push changes - run: | - git checkout $BRANCH - git add -A - git commit -m "Translated $LANGUAGE files" || true - git push --set-upstream origin $BRANCH - - name: Build mdBook run: | - MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/hacktricks-preprocessor.py b/hacktricks-preprocessor.py index af5949449..f07acbcdf 100644 --- a/hacktricks-preprocessor.py +++ b/hacktricks-preprocessor.py @@ -46,8 +46,8 @@ def ref(matchobj): match = re.search('