-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from hahwul/dev
Release v1.3.5
- Loading branch information
Showing
10 changed files
with
195 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
config: | ||
- changed-files: | ||
- any-glob-to-any-file: [deadfinder.gemspec, ruby-version, .rubocop.yml] | ||
dependencies: | ||
- changed-files: | ||
- any-glob-to-any-file: [Gemfile, Gemfile.lock, deadfinder.gemspec] | ||
workflow: | ||
- changed-files: | ||
- any-glob-to-any-file: [.github/workflows/**, .github/labeler.yml] | ||
github-action: | ||
- changed-files: | ||
- any-glob-to-any-file: [github-action/**, action.yml] | ||
docker: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- Dockerfile | ||
- .github/workflows/docker-ghcr.yml | ||
- github-action/Dockerfile | ||
code: | ||
- changed-files: | ||
- any-glob-to-any-file: [lib/**, bin/**, spec/**] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Contributors | ||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
inputs: | ||
logLevel: | ||
description: manual run | ||
required: false | ||
default: '' | ||
jobs: | ||
contributors: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: wow-actions/contributors-list@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
round: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: Pull Request Labeler | ||
on: [pull_request_target] | ||
jobs: | ||
labeler: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@v5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ deadfinder sitemap https://www.hahwul.com/sitemap.xml | |
```yml | ||
steps: | ||
- name: Run DeadFinder | ||
uses: hahwul/[email protected].4 | ||
uses: hahwul/[email protected].5 | ||
id: broken-link | ||
with: | ||
command: sitemap | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ghcr.io/hahwul/deadfinder:1.3.4 | ||
FROM ghcr.io/hahwul/deadfinder:1.3.5 | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod 755 /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
VERSION = '1.3.4' | ||
VERSION = '1.3.5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'uri' | ||
require_relative '../lib/deadfinder/utils' | ||
|
||
RSpec.describe 'Utils' do | ||
describe '#generate_url' do | ||
let(:base_url) { 'http://example.com/base/' } | ||
|
||
it 'returns the original URL if it starts with http://' do | ||
expect(generate_url('http://example.com', base_url)).to eq('http://example.com') | ||
end | ||
|
||
it 'returns the original URL if it starts with https://' do | ||
expect(generate_url('https://example.com', base_url)).to eq('https://example.com') | ||
end | ||
|
||
it 'prepends the scheme if the URL starts with //' do | ||
expect(generate_url('//example.com', base_url)).to eq('http://example.com') | ||
end | ||
|
||
it 'prepends the scheme and host if the URL starts with /' do | ||
expect(generate_url('/path', base_url)).to eq('http://example.com/path') | ||
end | ||
|
||
it 'returns nil if the URL should ignore the scheme' do | ||
expect(generate_url('mailto:[email protected]', base_url)).to be_nil | ||
end | ||
|
||
it 'prepends the base directory if the URL is relative' do | ||
expect(generate_url('relative/path', base_url)).to eq('http://example.com/base/relative/path') | ||
end | ||
end | ||
|
||
describe '#ignore_scheme?' do | ||
it 'returns true for mailto: URLs' do | ||
expect(ignore_scheme?('mailto:[email protected]')).to be true | ||
end | ||
|
||
it 'returns true for tel: URLs' do | ||
expect(ignore_scheme?('tel:1234567890')).to be true | ||
end | ||
|
||
it 'returns true for sms: URLs' do | ||
expect(ignore_scheme?('sms:1234567890')).to be true | ||
end | ||
|
||
it 'returns true for data: URLs' do | ||
expect(ignore_scheme?('data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==')).to be true | ||
end | ||
|
||
it 'returns true for file: URLs' do | ||
expect(ignore_scheme?('file:///path/to/file')).to be true | ||
end | ||
|
||
it 'returns false for other URLs' do | ||
expect(ignore_scheme?('http://example.com')).to be false | ||
end | ||
end | ||
|
||
describe '#extract_directory' do | ||
it 'returns the base URL if the path ends with /' do | ||
uri = URI('http://example.com/base/') | ||
expect(extract_directory(uri)).to eq('http://example.com/base/') | ||
end | ||
|
||
it 'returns the directory path if the path does not end with /' do | ||
uri = URI('http://example.com/base/file') | ||
expect(extract_directory(uri)).to eq('http://example.com/base/') | ||
end | ||
end | ||
end |