79671272

Date: 2025-06-18 20:47:26
Score: 1
Natty:
Report link

Thanks @alicia-sykes, you put me on the right path.

The final GitHub step became:

      - name: Setup Chrome sandbox for diagram rendering
        run: |
          sudo sysctl -w kernel.unprivileged_userns_clone=1
          sudo apt-get update
          sudo apt-get install -y google-chrome-stable

          CHROME_SANDBOX=$(dirname "$(which google-chrome-stable)")/chrome-sandbox

          # Additional fallback paths because Chrome is not necessarily installed 
          # in the default location, but there are known alternatives.
          if [ ! -f "$CHROME_SANDBOX" ]; then
            echo "Attempting fallback paths for chrome-sandbox..."
            if [ -f "/opt/google/chrome/chrome-sandbox" ]; then
              CHROME_SANDBOX="/opt/google/chrome/chrome-sandbox"
            elif [ -f "/usr/lib/chromium-browser/chrome-sandbox" ]; then
              CHROME_SANDBOX="/usr/lib/chromium-browser/chrome-sandbox"
            else
              echo "Error: chrome-sandbox could not be found in any known locations."
              exit 1
            fi
          fi

          sudo chown root:root "$CHROME_SANDBOX"
          sudo chmod 4755 "$CHROME_SANDBOX"

          echo 'Exporting CHROME_DEVEL_SANDBOX environment variable...'
          echo "CHROME_DEVEL_SANDBOX=$CHROME_SANDBOX" >> $GITHUB_ENV

Once I added this step to the workflow, the generation of the mermaid diagrams in the AsciiDoctor file succeeded.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @alicia-sykes
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Arc-E-Tect