Skip to content

prevent using branch names or shortened commit hashes for github blob… #24

prevent using branch names or shortened commit hashes for github blob…

prevent using branch names or shortened commit hashes for github blob… #24

Workflow file for this run

name: Lint JSON Files
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
lint-json:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Lint JSON Files
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_JSON: true
FILTER_REGEX_INCLUDE: .*data/.*
DEFAULT_BRANCH: "main"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Lint Source URLs
run: >-
for url in $(jq .items[].source_url < data/entries.json); do
echo $url | grep -q blob && (echo $url | sed -nr \
's,^"https://github.com/[^\/]*/[^\/]*/blob/([^/]*)/.+$,\1,p' |
grep -q '[0-9a-f]\{40\}' || (echo \
"Error: $url does not contain a commit hash." && exit 1));
done