{"id":23201286,"url":"https://github.com/adessose/blogpost-checker","last_synced_at":"2026-04-10T23:03:17.398Z","repository":{"id":43723804,"uuid":"252183980","full_name":"adessoSE/blogpost-checker","owner":"adessoSE","description":"Run checks to verify metadata of (Jekyll) blog posts 📄✔️","archived":false,"fork":false,"pushed_at":"2022-09-02T16:38:51.000Z","size":74641,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T00:41:29.815Z","etag":null,"topics":["checker","devblog","docker","github-api","java","jekyll","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adessoSE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-01T13:32:30.000Z","updated_at":"2024-10-05T07:11:20.000Z","dependencies_parsed_at":"2022-08-22T12:41:12.708Z","dependency_job_id":null,"html_url":"https://github.com/adessoSE/blogpost-checker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoSE%2Fblogpost-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoSE%2Fblogpost-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoSE%2Fblogpost-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoSE%2Fblogpost-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adessoSE","download_url":"https://codeload.github.com/adessoSE/blogpost-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247315008,"owners_count":20918952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["checker","devblog","docker","github-api","java","jekyll","spring-boot"],"created_at":"2024-12-18T15:14:46.640Z","updated_at":"2026-04-10T23:03:17.328Z","avatar_url":"https://github.com/adessoSE.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blogpost-checker\nRun checks to verify metadata of blog posts 📄✔️ (Designed for [Jekyll](https://jekyllrb.com) blogs).\n\nTerminates with a non 0 status on [errors](#Error-codes) ❌.\nCan be integrated with GitHub Actions to [check incoming pull requests](#Execution-via-GitHub-Action) 🚦.\nUsed in production for our very own [adesso devblog](github.com/adessoAG/devblog).\n\n## Executed checks\nBy default, executed checks depend on `authors.yml` and the metadata of the most recent blog post.\nWe thus have two sets of checks that will be run.\nYou can add [custom checks as well](#Adding-custom-checks).\n\n### Checking post metadata\nMetadata for adesso blog posts is expected to look like this:\n\n```\n---\nlayout: [post, post-xml]              \ntitle:  \"Title\"\ndate:   YYYY-MM-DD HH:MM      \nmodified_date: YYYY-MM-DD HH:MM\nauthor_ids: [authorNickname]\ncategories: [a single category]\ntags: [tag 1, tag2, tag 3]\n---\n```\n\nThese checks are currently executed for the post metadata:\n* `categories` cannot be empty\n* `categories` must contain only one entry\n* `categories` must be placed in brackets (`[ ]`)\n* `tags` cannot be empty\n* `tags` must be placed in brackets (`[ ]`)\n* `author_ids` cannot be empty\n* `author_ids` the names must be listed in the authors.yml file\n* `title` cannot be empty\n* `title` has to be placed in quotes\n* `layout` must equal [post, post-xml]\n* `date` cannot be empty\n* `date` must match the format `YYYY-MM-DD HH:mm`\n\n### Checking authors data\nEvery entry in `authors.yml` is expected to look like this.\nA post's metadata has to have a nickname that is listed in that file.\n\n```yml\nauthorNickname:\n  first_name: first name\n  last_name: last name\n  bio: \"author bio\"\n  avatar_url: /assets/images/avatars/\u003cauthor imange name\u003e.png\n```\n\nThese checks are currently executed for the `authors.yml`:\n* `first_name` cannot be empty\n* `last_name` cannot be empty\n* `bio` cannot be empty\n* `avatar_url` cannot be empty\n\n# Usage\nBlogpost-Checker comes in a docker container and can either be used standalone or in a GitHub Action.\nA non zero exit code will indicate a failed check.\nThis mechanism can be applied to check pull requests.\n\n## Required arguments\nTwo arguments are required to run the application:\n- `REPOSITORY_REMOTE_URL` = https://a-url-to-your-repository\n- `REPOSITORY_BRANCH_NAME` = the-git-branch-to-be-checked\n\nUpdates to the codebase are pushed to [jekyll2cms/blogpost-checker](https://hub.docker.com/r/jekyll2cms/blogpost-checker).\nMake sure to explicitly set the tag to `1.0.0`.\nAt this point, no [semantic versioning](https://semver.org/) is implemented.\n\n# Execution via GitHub Action\nCreate a workflow file in `.github/workflows/run-blogpost-checker.yml`\n\n```yml\nname: run-blogpost-checker\n\non: [pull_request]\n\njobs:\n  pull-and-run-blogpost-checker:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Inject env\n        uses: rlespinasse/github-slug-action@v3.x\n\n      - uses: actions/checkout@v2\n\n      - name: git log\n        run: |\n          MESSAGE=`cd /home/runner/work/devblog/devblog \u0026\u0026 git log --pretty=oneline`\n          echo \"$MESSAGE\"\n          HEAD_COMMIT=`echo \"$MESSAGE\" | sed -e 's/\\(.*\\)Merge\\s\\(.*\\) into \\(.*\\)/\\2/'`\n          BASE_COMMIT=`echo \"$MESSAGE\" | sed -e 's/\\(.*\\)Merge\\s\\(.*\\) into \\(.*\\)/\\3/'`\n          export HEAD_COMMIT=\"$HEAD_COMMIT\"\n          export BASE_COMMIT=\"$BASE_COMMIT\"\n          echo \"::set-env name=HEAD_COMMIT::$HEAD_COMMIT\"\n          echo \"::set-env name=BASE_COMMIT::$BASE_COMMIT\"\n        env:\n          ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'\n\n      - uses: actions/checkout@v2\n        with:\n          repository: ${{ github.event.pull_request.user.login }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}\n          ref: ${{ env.HEAD_COMMIT }}\n          fetch-depth: 0\n\n      - name: Run Docker image\n        run: docker run --env BASE_COMMIT='${{ env.BASE_COMMIT }}' --env HEAD_COMMIT='${{ env.HEAD_COMMIT }}' --env LOCAL_REPO_PATH=repo --env PR_NUMBER='${{ github.event.number  }}' -v /home/runner/work/devblog/devblog:/repo jekyll2cms/blogpost-checker:1.0.5\n```\n\nIn the case of the adesso devblog, we want every pull request to be checked and thus set `REPOSITORY_BRANCH_NAME` dynamically to the current branch.\nThis is achieved via `${{ github.head_ref }}`.\n\nWe also use a [GitHub Secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to store `REPOSITORY_REMOTE_URL`.\nYou don't have to though.\n\n# Execution via Docker\nThe process is very similar.\nEnvironment arguments are passed as simple strings though.\n\n```docker\ndocker run \n--env REPOSITORY_REMOTE_URL=https://a-url-to-your-repository \n--env REPOSITORY_BRANCH_NAME=the-git-branch-to-be-checked \njekyll2cms/blogpost-checker:1.0.0\n```\n\n# Execution via Gradle\nThe application can be run directly from your IDE.\nWe recommend this approach only for development purposes.\n\n1. Initialize the [Gradle](https://gradle.org/ ) project\n2. Make sure to set the environment arguments!\n3. Run `gradle bootRun`.\n\nFollow this guide to [define environment arguments in IntelliJ](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).\n\n## Known issue with Gradle execution\nThere is a known issue with consecutive runs:\n\n```java\nUNDEFINED EXCEPTION\norg.eclipse.jgit.api.errors.JGitInternalException: Destination path \"repository-to-be-checked\" already exists and is not an empty directory\n```\n\nDelete the `repository-to-be-checked` directory and try again if you encounter this error.\n\n# Adding custom checks\nYour custom check methods should be added inside `CheckExecutor.java`.\nA post's metadata and the author value can be passed as arguments.\n\nThe method structure might look like this:\n\n```java\nprivate void checkMyCustomCondition(PostMetadata metadata, String authors) {\n    if ( \u003c your check condition \u003e ) {\n        LOGGER.info(\"\u003cyour check was susccessful\u003e\");\n    } else {\n        ExitBlogpostChecker.exit(LOGGER, \"\u003cyour check failed due to your condition not being met\u003e\", \u003c your custom error code \u003e );\n    }\n}\n```\n\n# Error codes\nAvailable error codes include:\n\n| Error code | Message                                                                                                                                   |\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| 10         | Error: REPOSITORY_REMOTE_URL not configured                                                                                               |\n| 11         | Error: REPOSITORY_BRANCH_NAME not configured                                                                                              |\n| 12         | Error: HEAD_COMMIT not configured                                                                                                         |\n| 13         | Error: BASE_COMMIT not configured                                                                                                         |\n| 14         | Error: LOCAL_REPO_PATH not configured                                                                                                     |\n| 20         | Error while cloning remote git repository                                                                                                 |\n| 21         | Error reading authors.yml                                                                                                                 |\n| 23         | Error getting git branch                                                                                                                  |\n| 24         | Error accessing git api                                                                                                                   |\n| 25         | Error getting file content                                                                                                                |\n| 26         | Error getting authors.yml content from git                                                                                                |\n| 27         | Error while opening git repository                                                                                                        |\n| 300        | No category found. Exactly one category expected. Deprecated with 1.0.5                                                                   |\n| 301        | Two or more categories found. Exactly one category expected. Deprecated with 1.0.5                                                        |\n| 302        | The tags are empty. One or more tags expected. Deprecated with 1.0.5                                                                      |\n| 303        | No author found. Exactly one author expected. Deprecated with 1.0.5                                                                       |\n| 304        | The selected author was not found in authors.yml. Make sure author exists and is spelled correctly in the blogpost. Deprecated with 1.0.5 |\n| 305        | Blogpost title is missing. Provide a title. Deprecated with 1.0.5                                                                         |\n| 306        | 'Layout' does not contain 'post, post-xml'. Make sure to use 'layout: [post, post-xml]'. Deprecated with 1.0.5                            |\n| 307        | Date format error. Adapt to accepted pattern YYYY-MM-DD HH:mm. Deprecated with 1.0.5                                                      |\n| 310        | Author first name is missing. Provide a first name. Deprecated with 1.0.5                                                                 |\n| 311        | Author last name is missing. Provide a last name. Deprecated with 1.0.5                                                                   |\n| 312        | Author github username is missing. Provide a github username. Deprecated with 1.0.5                                                       |\n| 313        | Author email is missing. Provide a email. Deprecated with 1.0.5                                                                           |\n| 314        | Email format error. Adapt to accepted pattern ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$. Deprecated with 1.0.5                    |\n| 315        | Author bio is missing. Provide a bio. Deprecated with 1.0.5                                                                               |\n| 316        | Author avatar url is missing. Provide an avatar url. Deprecated with 1.0.5                                                                |\n| 317        | Author github is missing. Provide a github link. Deprecated with 1.0.5                                                                    |\n| 318        | There were errors in the blog post.                                                                                                       |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadessose%2Fblogpost-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadessose%2Fblogpost-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadessose%2Fblogpost-checker/lists"}