-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fail-if-empty
- Loading branch information
Showing
16 changed files
with
486 additions
and
124 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,2 @@ | ||
open_collective: lychee-collective | ||
github: mre |
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,17 @@ | ||
name: 'Merge Dependencies' | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
auto-merge: | ||
runs-on: ubuntu-latest | ||
if: github.actor == 'dependabot[bot]' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ahmadnassri/[email protected] | ||
with: | ||
github-token: ${{ secrets.AUTOMERGE_TOKEN }} | ||
# Merge all updates as long as they pass CI. | ||
# Includes minor and patch updates. | ||
update_type: "semver:major" |
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 was deleted.
Oops, something went wrong.
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,162 @@ | ||
on: | ||
- repository_dispatch | ||
- workflow_dispatch | ||
- push | ||
- pull_request | ||
|
||
env: | ||
CUSTOM_OUTPUT_RELATIVE_PATH: lychee/custom_output.md | ||
CUSTOM_OUTPUT_ABSOLUTE_PATH: /tmp/report.md | ||
CUSTOM_OUTPUT_DUMP_PATH: /tmp/dump.md | ||
|
||
jobs: | ||
lychee-action: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
name: Test the lychee link checker action | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: test defaults | ||
uses: ./ | ||
with: | ||
fail: true | ||
|
||
- name: test explicit lychee version | ||
uses: ./ | ||
with: | ||
lycheeVersion: v0.14.0 | ||
|
||
- name: test globs | ||
uses: ./ | ||
with: | ||
args: >- | ||
--exclude-mail | ||
--verbose | ||
--no-progress | ||
'./**/*.md' | ||
'./**/*.html' | ||
'./**/*.rst' | ||
fail: true | ||
|
||
- name: test --base argument | ||
uses: ./ | ||
with: | ||
args: >- | ||
--base . | ||
--verbose | ||
--no-progress | ||
'./**/*.md' | ||
'./**/*.html' | ||
'./**/*.rst' | ||
fail: true | ||
|
||
- name: test custom output relative path - creation | ||
uses: ./ | ||
with: | ||
output: "${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}" | ||
debug: true | ||
|
||
- name: test custom output relative path - validation | ||
run: | | ||
echo "Checking custom output file at ${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}" | ||
if [ ! -f "${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}" ]; then | ||
echo "Not found" | ||
exit 1 | ||
else | ||
echo "Found. Contents:" | ||
cat "${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}" | ||
fi | ||
- name: test custom output absolute path - creation | ||
uses: ./ | ||
with: | ||
output: "${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}" | ||
debug: true | ||
|
||
- name: test custom output absolute path - validation | ||
run: | | ||
echo "Checking custom output file at ${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}" | ||
if [ ! -f "${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}" ]; then | ||
echo "Not found" | ||
exit 1 | ||
else | ||
echo "Found. Contents:" | ||
cat "${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}" | ||
fi | ||
- name: test dump with custom output path - creation | ||
uses: ./ | ||
with: | ||
args: --dump './**/*.md' './**/*.html' './**/*.rst' | ||
output: "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}" | ||
debug: true | ||
|
||
- name: test dump with custom output path - validation | ||
run: | | ||
echo "Checking dump output file at ${{ env.CUSTOM_OUTPUT_DUMP_PATH }}" | ||
if [ ! -f "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}" ]; then | ||
echo "Not found" | ||
exit 1 | ||
else | ||
echo "Found. Contents:" | ||
cat "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}" | ||
fi | ||
- name: Install jq | ||
run: sudo apt-get install jq | ||
|
||
- name: test workflow inputs - Markdown | ||
uses: ./ | ||
with: | ||
args: -v fixtures/TEST.md | ||
format: json | ||
output: ${{ github.workspace }}/foo_md.json | ||
fail: true | ||
|
||
- name: Validate JSON - Markdown | ||
run: | | ||
if ! jq empty ${{ github.workspace }}/foo_md.json; then | ||
echo "Output file does not exist or is not valid JSON" | ||
exit 1 | ||
fi | ||
- name: test workflow inputs - rST | ||
uses: ./ | ||
with: | ||
args: -v fixtures/TEST.rst | ||
format: json | ||
output: ${{ github.workspace }}/foo_rst.json | ||
fail: true | ||
|
||
- name: Validate JSON - rST | ||
run: | | ||
if ! jq empty ${{ github.workspace }}/foo_rst.json; then | ||
echo "Output file does not exist or is not valid JSON" | ||
exit 1 | ||
fi | ||
- name: directory | ||
uses: ./ | ||
with: | ||
args: --exclude-mail . | ||
fail: true | ||
|
||
- name: test format override | ||
uses: ./ | ||
with: | ||
args: --format markdown -v fixtures/TEST.md | ||
format: doesnotexist # gets ignored if format set in args | ||
output: ${{ github.workspace }}/foo.txt | ||
fail: true | ||
|
||
- name: test debug | ||
uses: ./ | ||
with: | ||
debug: true | ||
|
||
- name: test custom GitHub token | ||
uses: ./ | ||
with: | ||
token: ${{ secrets.CUSTOM_TOKEN }} |
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,37 @@ | ||
on: | ||
- repository_dispatch | ||
- workflow_dispatch | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
lychee-action: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
name: Test cache | ||
steps: | ||
- name: Restore lychee cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: .lycheecache | ||
key: cache-lychee-${{ github.sha }} | ||
restore-keys: cache-lychee- | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Lychee URL checker | ||
uses: lycheeverse/lychee-action@v1 | ||
with: | ||
args: >- | ||
--cache | ||
--verbose | ||
--no-progress | ||
'./**/*.md' | ||
'./**/*.html' | ||
'./**/*.rst' | ||
# Fail the action on broken links. | ||
# If the pipeline fails, the cache will _not_ be stored | ||
fail: true | ||
env: | ||
# to be used in case rate limits are surpassed | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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,15 @@ | ||
name: Keep major version tags up-to-date | ||
|
||
on: | ||
release: | ||
types: [published, edited] | ||
|
||
jobs: | ||
actions-tagger: | ||
name: Tag GitHub Action | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Actions-R-Us/actions-tagger@v2 | ||
with: | ||
publish_latest_tag: false | ||
prefer_branch_releases: false |
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,2 @@ | ||
lycheeverse/lychee-action@.* | ||
https://github.com/org/repo |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.