mirror of
https://github.com/sindresorhus/awesome.git
synced 2024-12-25 02:15:26 +00:00
github/workflows directory
This commit is contained in:
parent
07c6be2660
commit
8f4d683586
14
.github/workflows/main.yml
vendored
14
.github/workflows/main.yml
vendored
@ -1,14 +0,0 @@
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'readme.md'
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: awesome-lint
|
||||
run: ./.github/workflows/repo_linter.sh
|
22
.github/workflows/repo_linter.sh
vendored
22
.github/workflows/repo_linter.sh
vendored
@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Find the repo in the git diff and then set it to an env variables.
|
||||
REPO_TO_LINT=$(
|
||||
git diff origin/main -- readme.md |
|
||||
# Look for changes (indicated by lines starting with +).
|
||||
grep ^+ |
|
||||
# Get the line that includes the readme.
|
||||
grep -Eo 'https.*#readme' |
|
||||
# Get just the URL.
|
||||
sed 's/#readme//')
|
||||
|
||||
# If there's no repo found, exit quietly.
|
||||
if [ -z "$REPO_TO_LINT" ]; then
|
||||
echo "No new link found in the format: https://....#readme"
|
||||
else
|
||||
echo "Cloning $REPO_TO_LINT"
|
||||
mkdir cloned
|
||||
cd cloned
|
||||
git clone "$REPO_TO_LINT" .
|
||||
npx awesome-lint
|
||||
fi
|
Loading…
Reference in New Issue
Block a user