Fix reporting issue with first step and add tests for the action #15
Workflow file for this run
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
name: Test the check-repo action | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Action should fail for non GitHub repo URLs | |
id: reject-invalid-url | |
uses: ./ | |
with: | |
globs: README.md | |
submissionJsonPath: test/invalid-repo.json | |
testMode: "true" | |
- name: Report result of previous test | |
run: | | |
if [ "${{ steps.reject-invalid-url.outputs.result }}" != "failure" ]; then | |
echo "Action did not fail for an invalid URL" | |
exit 1 | |
fi | |
- name: Action should fail for URL that is points to a resource inside a repo | |
id: reject-deep-github-url | |
uses: ./ | |
with: | |
globs: README.md | |
submissionJsonPath: test/deep-link.json | |
testMode: "true" | |
- name: Report result of previous test | |
run: | | |
if [ "${{ steps.reject-deep-github-url.outputs.result }}" != "failure" ]; then | |
echo "Action did not fail for a folder / file URL within a repo" | |
exit 1 | |
fi | |
- name: Action should fail for GitHub repo URL that is inaccessible | |
id: reject-inaccessible-github-url | |
uses: ./ | |
with: | |
globs: README.md | |
submissionJsonPath: test/non-existent-repo.json | |
testMode: "true" | |
- name: Report result of previous test | |
run: | | |
if [ "${{ steps.reject-inaccessible-github-url.outputs.result }}" != "failure" ]; then | |
echo "Action did not fail for an inaccessible GitHub repo URL" | |
exit 1 | |
fi |