From 9443cd38e01a434cd453b8ab2fbbce13d7cae8dc Mon Sep 17 00:00:00 2001 From: Gaurav Nelson <23069445+gaurav-nelson@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:52:13 +1000 Subject: [PATCH] Fix: Enabled user namespace cloning to fix issues on ubuntu-24.04 --- .github/workflows/test.yml | 6 +++--- README.md | 4 +--- script.sh | 9 +++++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8beeef1..4a5b221 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ on: jobs: test-check: name: runner / linkspector (github-check) - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./ @@ -22,7 +22,7 @@ jobs: test-pr-check: if: github.event_name == 'pull_request' name: runner / linkspector (github-pr-check) - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./ @@ -34,7 +34,7 @@ jobs: test-pr-review: if: github.event_name == 'pull_request' name: runner / linkspector (github-pr-review) - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./ diff --git a/README.md b/README.md index c89948e..288fe3b 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,13 @@ This action runs [Linkspector](https://github.com/UmbrellaDocs/linkspector) with 1. Create a new file in your repository `.github/workflows/action.yml`. 1. Copy-paste the following workflow in your `action.yml` file: - > **IMPORTANT**: Make sure to use `ubuntu-22.04` as the runner for this action. See https://github.com/UmbrellaDocs/action-linkspector/issues/25 for more details. - ```yaml name: Linkspector on: [pull_request] jobs: check-links: name: runner / linkspector - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run linkspector diff --git a/script.sh b/script.sh index 8556fa5..72214cf 100755 --- a/script.sh +++ b/script.sh @@ -13,6 +13,15 @@ echo '🔗💀 linkspector version:' linkspector --version echo '::endgroup::' +echo '::group::🔗💀 Setting up Chrome Linux Sandbox' +# Based on the recommendation from https://pptr.dev/troubleshooting#recommended-enable-user-namespace-cloning +if [ "$(lsb_release -rs)" = "24.04" ]; then + sudo sysctl -w kernel.unprivileged_userns_clone=1 + echo 'Done' +fi + +echo '::endgroup::' + echo '::group:: Running linkspector with reviewdog 🐶 ...' linkspector check -c "${INPUT_CONFIG_FILE}" -j | reviewdog -f=rdjson \