Skip to content

Commit

Permalink
Update GitHub actions in build_check_links.yml workflow
Browse files Browse the repository at this point in the history
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
  • Loading branch information
anthonyfok committed Feb 6, 2025
1 parent 1f3fa2b commit e5c638e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build_check_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

- 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: |
Expand All @@ -45,4 +50,3 @@ jobs:
run: |
less ./lychee/out.md
exit 1

0 comments on commit e5c638e

Please sign in to comment.