From 780f568739fbc7c1497c124dc86dc0008bfec940 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Thu, 6 Feb 2025 15:31:34 -0700 Subject: [PATCH] Update GitHub actions in build_check_links.yml workflow Fixes the following error that occurs with the latest ubuntu-latest (now ubuntu-24.04, was probably ubuntu-22.04 or even ubuntu-20.04): Installing Bundler /opt/hostedtoolcache/Ruby/2.6.7/x64/bin/gem install bundler -v ~> 2 --no-document ERROR: Error installing bundler: The last version of bundler (~> 2) to support your Ruby & RubyGems was 2.4.22. Try installing it with `gem install bundler -v 2.4.22` bundler requires Ruby version >= 3.1.0. The current ruby version is 2.6.7.197. Took 14.29 seconds Error: The process '/opt/hostedtoolcache/Ruby/2.6.7/x64/bin/gem' failed with exit code 1 --- .github/workflows/build_check_links.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_check_links.yml b/.github/workflows/build_check_links.yml index 9daa963..bcb7fcd 100644 --- a/.github/workflows/build_check_links.yml +++ b/.github/workflows/build_check_links.yml @@ -9,27 +9,32 @@ jobs: name: Check for broken links runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby - uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6 + uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: '3.3' bundler-cache: true - - run: | + - name: Run "bundle install" + - run | cd docs bundle install + + - name: Build site with Jekyll + - run: | + cd docs jekyll build - name: Link Checker - uses: lycheeverse/lychee-action@v1.1.0 + uses: lycheeverse/lychee-action@v2 with: args: ./docs/_site/* -b https://opendrr.github.io --exclude https://opendrr.github.io/assets/fontawesome/css/all.min.css - name: Add comment if broken links if: ${{ github.event_name == 'pull_request' && hashFiles('./lychee/out.md') != '' }} - uses: actions/github-script@v3 + uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -45,4 +50,3 @@ jobs: run: | less ./lychee/out.md exit 1 - \ No newline at end of file