Skip to content

Fix reporting issue with first step and add tests for the action #15

Fix reporting issue with first step and add tests for the action

Fix reporting issue with first step and add tests for the action #15

Workflow file for this run

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