From 142e938d570c35d2deebe4ddad2dab40cab32bb3 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 12:52:25 -1000 Subject: [PATCH 01/14] auto awesome-lint any list added to the readme in a PR --- .github/workflows/main.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..7a1f6c1d72 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,43 @@ +# This is a basic workflow for github actions + +name: lint_new_list + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + pull_request: + branches: [main] + ## only run this job when readme changes + paths: + - 'readme.md' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + run_awesome_lint: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # by default github actions doesn't fetch the whole repo so we are getting the latest commit on main + - name: fetch + run: git fetch origin main:main --depth=1 + + # find the repo in the git diff and then set it to an env variables + - name: find repo + run: 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 + - name: validate repo + run: if [ -z ${REPO_TO_LINT+x} ]; then echo "Link to your list using the form https://....#readme" && exit 0; else echo "Repo detected '$var'"; fi + + # Clone the repo into a new folder + - name: clone + run: echo "Cloning $REPO_TO_LINT" && mkdir cloned && cd cloned && git clone --depth=1 "$REPO_TO_LINT" . + + - name: lint + run: npx awesome-lint \ No newline at end of file From 0775f9cfa976fbb5873386c67b8beda205bd85f8 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 12:59:08 -1000 Subject: [PATCH 02/14] add blank line --- .github/workflows/main.yml | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a1f6c1d72..5a979d0ba7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,4 +40,4 @@ jobs: run: echo "Cloning $REPO_TO_LINT" && mkdir cloned && cd cloned && git clone --depth=1 "$REPO_TO_LINT" . - name: lint - run: npx awesome-lint \ No newline at end of file + run: npx awesome-lint diff --git a/readme.md b/readme.md index 51893ea180..4ccdd7946f 100755 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@

What is an awesome list?    Contribution guide    - Creating a list    + Creating a list    Twitter    Stickers & t-shirts

From c2c8cd71106e0b68d6562a3c11b7d4f07fec13f5 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:03:06 -1000 Subject: [PATCH 03/14] run script --- .github/workflows/main.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a979d0ba7..f6890a0fda 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,20 +24,20 @@ jobs: - uses: actions/checkout@v2 # by default github actions doesn't fetch the whole repo so we are getting the latest commit on main - - name: fetch - run: git fetch origin main:main --depth=1 + - name: run lint script + run: ./.github/workflows/repo_linter.sh - # find the repo in the git diff and then set it to an env variables - - name: find repo - run: git diff main readme.md | grep ^+ | grep -Eo 'https.*#readme' | sed 's/#readme//' | xargs -I {} echo "::set-env name=REPO_TO_LINT::{}" + # # find the repo in the git diff and then set it to an env variables + # - name: find repo + # run: 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 - - name: validate repo - run: if [ -z ${REPO_TO_LINT+x} ]; then echo "Link to your list using the form https://....#readme" && exit 0; else echo "Repo detected '$var'"; fi + # # If there's no repo found leave an error message + # - name: validate repo + # run: if [ -z ${REPO_TO_LINT+x} ]; then echo "Link to your list using the form https://....#readme" && exit 0; else echo "Repo detected '$var'"; fi - # Clone the repo into a new folder - - name: clone - run: echo "Cloning $REPO_TO_LINT" && mkdir cloned && cd cloned && git clone --depth=1 "$REPO_TO_LINT" . + # # Clone the repo into a new folder + # - name: clone + # run: echo "Cloning $REPO_TO_LINT" && mkdir cloned && cd cloned && git clone --depth=1 "$REPO_TO_LINT" . - - name: lint - run: npx awesome-lint + # - name: lint + # run: npx awesome-lint From baf9822e1c4a2833b630148d5466c764d1386059 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:05:55 -1000 Subject: [PATCH 04/14] add linter script --- .github/workflows/repo_linter.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .github/workflows/repo_linter.sh diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh new file mode 100755 index 0000000000..18e6f9068a --- /dev/null +++ b/.github/workflows/repo_linter.sh @@ -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 From 9a5feecc224ae031ca86397c1994ea1963cf2dea Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:08:50 -1000 Subject: [PATCH 05/14] lint my repo --- .github/workflows/repo_linter.sh | 10 ++++++---- readme.md | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh index 18e6f9068a..7be6c0e7b3 100755 --- a/.github/workflows/repo_linter.sh +++ b/.github/workflows/repo_linter.sh @@ -9,10 +9,12 @@ git diff main readme.md | grep ^+ | grep -Eo 'https.*#readme' | sed 's/#readme// # 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; + echo "No new link found in the format: https://....#readme" 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" . + echo "Repo detected '$var'" + echo "Cloning $REPO_TO_LINT" + mkdir cloned + cd cloned + git clone --depth=1 "$REPO_TO_LINT" . npx awesome-lint fi diff --git a/readme.md b/readme.md index 4ccdd7946f..970597353b 100755 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@

What is an awesome list?    Contribution guide    - Creating a list    + Creating a list    Twitter    Stickers & t-shirts

@@ -554,7 +554,7 @@ - [Tools of the Trade](https://github.com/cjbarber/ToolsOfTheTrade#readme) - Tools used by companies on Hacker News. - [Clean Tech](https://github.com/nglgzz/awesome-clean-tech#readme) - Fighting climate change with technology. - [Wardley Maps](https://github.com/wardley-maps-community/awesome-wardley-maps#readme) - Provides high situational awareness to help improve strategic planning and decision making. -- [Social Enterprise](https://github.com/RayBB/awesome-social-enterprise#readme) - Building an organization primarily focused on social impact that is at least partially self-funded. +- [Social Enterprise](https://github.com/RayBB/awesome-social-enterprise#readme) - Building an organization primarily focused on social impact that is at least partially self-funded.. - [Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management#readme) - How to transition from software development to engineering management. - [Developer-First Products](https://github.com/agamm/awesome-developer-first#readme) - Products that target developers as the user. From 00ee39ab77b3ba804828f8e2ceee3e9427e31719 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:15:40 -1000 Subject: [PATCH 06/14] repo to lint variable --- .github/workflows/repo_linter.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh index 7be6c0e7b3..404f533645 100755 --- a/.github/workflows/repo_linter.sh +++ b/.github/workflows/repo_linter.sh @@ -4,7 +4,14 @@ 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::{}" +REPO_TO_LINT=$( + git diff main readme.md | + # Look for changes (indicated by lines startingi 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 leave an error message if [ -z ${REPO_TO_LINT+x} ]; From 63957236c27eeb75d57f87f1c014177f9e96bc81 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:16:58 -1000 Subject: [PATCH 07/14] cleanup yml --- .github/workflows/main.yml | 17 +---------------- .github/workflows/repo_linter.sh | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6890a0fda..3fba6d8aeb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,21 +23,6 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - # by default github actions doesn't fetch the whole repo so we are getting the latest commit on main + # Run the script that will lint any new repo added to readme - name: run lint script run: ./.github/workflows/repo_linter.sh - - # # find the repo in the git diff and then set it to an env variables - # - name: find repo - # run: 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 - # - name: validate repo - # run: if [ -z ${REPO_TO_LINT+x} ]; then echo "Link to your list using the form https://....#readme" && exit 0; else echo "Repo detected '$var'"; fi - - # # Clone the repo into a new folder - # - name: clone - # run: echo "Cloning $REPO_TO_LINT" && mkdir cloned && cd cloned && git clone --depth=1 "$REPO_TO_LINT" . - - # - name: lint - # run: npx awesome-lint diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh index 404f533645..ad3e6c3314 100755 --- a/.github/workflows/repo_linter.sh +++ b/.github/workflows/repo_linter.sh @@ -13,7 +13,7 @@ REPO_TO_LINT=$( # Get just the url sed 's/#readme//') -# If there's no repo found leave an error message +# If there's no repo found exit quietly if [ -z ${REPO_TO_LINT+x} ]; then echo "No new link found in the format: https://....#readme" From 2ad4495e48814fad548a70da8c9b2aa595628279 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:18:03 -1000 Subject: [PATCH 08/14] works when change doesn't have repo --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 970597353b..97f28bbc40 100755 --- a/readme.md +++ b/readme.md @@ -554,11 +554,11 @@ - [Tools of the Trade](https://github.com/cjbarber/ToolsOfTheTrade#readme) - Tools used by companies on Hacker News. - [Clean Tech](https://github.com/nglgzz/awesome-clean-tech#readme) - Fighting climate change with technology. - [Wardley Maps](https://github.com/wardley-maps-community/awesome-wardley-maps#readme) - Provides high situational awareness to help improve strategic planning and decision making. -- [Social Enterprise](https://github.com/RayBB/awesome-social-enterprise#readme) - Building an organization primarily focused on social impact that is at least partially self-funded.. +- [Social Enterprise](https://github.com/RayBB/awesome-social-enterprise#readme) - Building an organization primarily focused on social impact that is at least partially self-funded. - [Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management#readme) - How to transition from software development to engineering management. - [Developer-First Products](https://github.com/agamm/awesome-developer-first#readme) - Products that target developers as the user. -## Work +## Work - [Slack](https://github.com/matiassingers/awesome-slack#readme) - Team collaboration. - [Communities](https://github.com/filipelinhares/awesome-slack#readme) From 4297a26ee91f4bb9e1bdf8eea8a69ff6f98cc59d Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:18:49 -1000 Subject: [PATCH 09/14] no readme change --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 97f28bbc40..51893ea180 100755 --- a/readme.md +++ b/readme.md @@ -558,7 +558,7 @@ - [Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management#readme) - How to transition from software development to engineering management. - [Developer-First Products](https://github.com/agamm/awesome-developer-first#readme) - Products that target developers as the user. -## Work +## Work - [Slack](https://github.com/matiassingers/awesome-slack#readme) - Team collaboration. - [Communities](https://github.com/filipelinhares/awesome-slack#readme) From 5f6ae82370fbf663a284fd2cefa8227eb3b9ac0a Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Mon, 8 Mar 2021 13:20:21 -1000 Subject: [PATCH 10/14] remove extra echo --- .github/workflows/repo_linter.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh index ad3e6c3314..6c5e3b9822 100755 --- a/.github/workflows/repo_linter.sh +++ b/.github/workflows/repo_linter.sh @@ -18,7 +18,6 @@ if [ -z ${REPO_TO_LINT+x} ]; then echo "No new link found in the format: https://....#readme" else - echo "Repo detected '$var'" echo "Cloning $REPO_TO_LINT" mkdir cloned cd cloned From 21f0a11fd59a12e08884f2ec0ef88d1cad86c78d Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 22 Mar 2021 15:21:42 +0700 Subject: [PATCH 11/14] Update repo_linter.sh --- .github/workflows/repo_linter.sh | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh index 6c5e3b9822..6613f68011 100755 --- a/.github/workflows/repo_linter.sh +++ b/.github/workflows/repo_linter.sh @@ -3,24 +3,23 @@ # 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 +# Find the repo in the git diff and then set it to an env variables. REPO_TO_LINT=$( - git diff main readme.md | - # Look for changes (indicated by lines startingi with +) - grep ^+ | - # Get the line that includes the readme - grep -Eo 'https.*#readme' | - # Get just the url - sed 's/#readme//') + git diff main readme.md | + # Look for changes (indicated by lines startingi 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+x} ]; -then - echo "No new link found in the format: https://....#readme" +# If there's no repo found, exit quietly. +if [ -z ${REPO_TO_LINT+x} ]; then + echo "No new link found in the format: https://....#readme" else - echo "Cloning $REPO_TO_LINT" - mkdir cloned - cd cloned - git clone --depth=1 "$REPO_TO_LINT" . - npx awesome-lint + echo "Cloning $REPO_TO_LINT" + mkdir cloned + cd cloned + git clone --depth=1 "$REPO_TO_LINT" . + npx awesome-lint fi From f9a013ecae4dae450f326cb42e48931cab649856 Mon Sep 17 00:00:00 2001 From: Ray Berger Date: Tue, 30 Mar 2021 15:10:27 -1000 Subject: [PATCH 12/14] move git fetch to yaml and remove comments --- .github/workflows/main.yml | 20 +++----------------- .github/workflows/repo_linter.sh | 3 --- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3fba6d8aeb..b0061fbaf8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,28 +1,14 @@ -# This is a basic workflow for github actions - -name: lint_new_list - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: pull_request: branches: [main] - ## only run this job when readme changes paths: - 'readme.md' - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - run_awesome_lint: - # The type of runner that the job will run on + lint: runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - # Run the script that will lint any new repo added to readme + with: + fetch-depth: 0 - name: run lint script run: ./.github/workflows/repo_linter.sh diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh index 6613f68011..11b89b7a56 100755 --- a/.github/workflows/repo_linter.sh +++ b/.github/workflows/repo_linter.sh @@ -1,8 +1,5 @@ #!/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. REPO_TO_LINT=$( git diff main readme.md | From 1de618196516abeb33cf65e1699952c9cb626279 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 19 Apr 2021 16:57:48 +0700 Subject: [PATCH 13/14] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0061fbaf8..db9455f3bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,5 +10,5 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: run lint script + - name: awesome-lint run: ./.github/workflows/repo_linter.sh From d27b8769dc9bcdea5951cbb1c5340a581b0612bb Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 19 Apr 2021 16:58:28 +0700 Subject: [PATCH 14/14] Update repo_linter.sh --- .github/workflows/repo_linter.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/repo_linter.sh b/.github/workflows/repo_linter.sh index 11b89b7a56..a407f9c8b3 100755 --- a/.github/workflows/repo_linter.sh +++ b/.github/workflows/repo_linter.sh @@ -3,11 +3,11 @@ # Find the repo in the git diff and then set it to an env variables. REPO_TO_LINT=$( git diff main readme.md | - # Look for changes (indicated by lines startingi with +) + # Look for changes (indicated by lines starting with +). grep ^+ | - # Get the line that includes the readme + # Get the line that includes the readme. grep -Eo 'https.*#readme' | - # Get just the url + # Get just the URL. sed 's/#readme//') # If there's no repo found, exit quietly.