Skip to content

Latest commit

 

History

History

examples

Examples

The following examples are added for your convenience. Each of these files would be added to a .github/workflows folder to be run on some github event. Note that the files reference the "master" branch of the repository for consistency, however you should change this to an actual release for your deployment.

General

  • GitHub Checkout: the most likely case of usage for this action is checking out the repository that the action is running for, meaning we use the active branch for the check.
  • GitHub Clone: while it's more a niche use case, you might want to clone one or more repos to check for an action run.

Excluding Files and Folders

  • urlchecker-exclude-files.yml: in this example, we have a repository where we want to check only a README.md file at the root, and importantly, skip over an entire subfolder that serves a rendered site at docs. We want to run the check whenever someone opens a pull request.

Include Files

  • urlchecker-include-files.yml: as an alternative to excluding files or patterns, you can specify an explicit file path or pattern to check. This is useful if you want to set some comma separated listing of files or patterns in another step, and then set for the action here.

Saving

Pull request

  • urlchecker-pr-label.yml checks URLs in files modified by a PR when you apply a "needs-url-checks" label, then it removes the "needs-url-checks" label. You need to create the label first. The PR can be labelled and unlabelled several times. The workflow creates a check run.

If you'd like to see an example added, please open an issue.

Jekyll

  • urlchecker-jekyll.yml will use a ruby action to install ruby, needed gems, and then run the urlchecker for the rendered _site. You could also do the same without the build, meaning testing all static files in the repository without needing to build _site.