Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run awesome-lint on new additions #1962

Merged
merged 14 commits into from
Apr 19, 2021
Prev Previous commit
Next Next commit
add linter script
RayBB committed Mar 8, 2021
commit baf9822e1c4a2833b630148d5466c764d1386059
18 changes: 18 additions & 0 deletions .github/workflows/repo_linter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# by default github actions doesn't fetch the whole repo so we are getting the latest commit on main
git fetch origin main:main --depth=1

# find the repo in the git diff and then set it to an env variables
git diff main readme.md | grep ^+ | grep -Eo 'https.*#readme' | sed 's/#readme//' | xargs -I {} echo "::set-env name=REPO_TO_LINT::{}"

# If there's no repo found leave an error message
if [ -z ${REPO_TO_LINT+x} ];
then
echo "Link to your list using the form https://....#readme" && exit 0;
else
echo "Repo detected '$var'";
# Clone the repo into a new folder
echo "Cloning $REPO_TO_LINT" && mkdir cloned && cd cloned && git clone --depth=1 "$REPO_TO_LINT" .
npx awesome-lint
fi