From d756a7b3dd8d94a4f56a92294f1bcf4ff8d59a1f Mon Sep 17 00:00:00 2001 From: Rewanth Tammana <22347290+rewanthtammana@users.noreply.github.com> Date: Sat, 14 Aug 2021 22:54:17 +0400 Subject: [PATCH 1/6] Create github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 0000000..1e714de --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,28 @@ +name: GitHub Actions Demo +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: | + apt-get update && apt-get -y install jq git + git clone https://github.com/tldrrun/tools.tldr.run + cd tools.tldr.run/tools + cat *.json | jq '.name' + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - run: echo "Wow ${{ github.base_ref }} - ${{ github.head_ref }}" + - run: | + git clone https://github.com/${{ github.repository }} -b `echo ${{ github.ref }} | cut -d'/' -f3` + cd tools.tldr.run + git checkout main && git fetch + git diff --name-status main..`echo ${{ github.ref }} | cut -d'/' -f3` +# - name: Check out repository code +# uses: actions/checkout@v2 +# - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From e4e247f7f9debc2eeb52d7350c800f4335a93b2f Mon Sep 17 00:00:00 2001 From: Rewanth Tammana <22347290+rewanthtammana@users.noreply.github.com> Date: Sat, 14 Aug 2021 22:57:05 +0400 Subject: [PATCH 2/6] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 1e714de..7592097 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -6,9 +6,9 @@ jobs: steps: - run: | apt-get update && apt-get -y install jq git - git clone https://github.com/tldrrun/tools.tldr.run - cd tools.tldr.run/tools - cat *.json | jq '.name' +# git clone https://github.com/tldrrun/tools.tldr.run +# cd tools.tldr.run/tools +# cat *.json | jq '.name' - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." @@ -17,7 +17,7 @@ jobs: git clone https://github.com/${{ github.repository }} -b `echo ${{ github.ref }} | cut -d'/' -f3` cd tools.tldr.run git checkout main && git fetch - git diff --name-status main..`echo ${{ github.ref }} | cut -d'/' -f3` + git diff --name-status main..`echo ${{ github.ref }} | cut -d'/' -f3` # - name: Check out repository code # uses: actions/checkout@v2 # - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." From 987c8d0f22853cec0024724cf51adbdcd5ba361d Mon Sep 17 00:00:00 2001 From: Rewanth Tammana <22347290+rewanthtammana@users.noreply.github.com> Date: Sat, 14 Aug 2021 22:58:33 +0400 Subject: [PATCH 3/6] Create test.json --- tools/test.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tools/test.json diff --git a/tools/test.json b/tools/test.json new file mode 100644 index 0000000..de2f8a2 --- /dev/null +++ b/tools/test.json @@ -0,0 +1,32 @@ +{ + "name": "Test", + "description": "Test description", + "tags": [ + "data-security", + "database-security", + "sql", + "sql-security", + "cryptography", + "firewall", + "sql-firewall", + "data-tokenization", + "data-masking", + "encryption", + "blue-team", + "honeypot", + "canary-token", + "end-to-end-encryption" + ], + "operating_systems": [ + "linux", + "mac" + ], + "license": "Apache-2.0", + "availability": [ + "opensource", + "free", + "commercial" + ], + "github_url": "https://github.com/test/acra", + "url": "https://www.test.com/acra/" +} From 39c34597ebaa1f406e1e1696fbe25451f71ffe86 Mon Sep 17 00:00:00 2001 From: Rewanth Tammana <22347290+rewanthtammana@users.noreply.github.com> Date: Sat, 14 Aug 2021 22:59:17 +0400 Subject: [PATCH 4/6] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 7592097..710dca1 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - run: | - apt-get update && apt-get -y install jq git + sudo apt-get update && sudo apt-get -y install jq git # git clone https://github.com/tldrrun/tools.tldr.run # cd tools.tldr.run/tools # cat *.json | jq '.name' From 809f8d3f3f4bf81157a11c4d0da996879a33fe67 Mon Sep 17 00:00:00 2001 From: Rewanth Tammana <22347290+rewanthtammana@users.noreply.github.com> Date: Sat, 14 Aug 2021 23:56:59 +0400 Subject: [PATCH 5/6] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 710dca1..01ed256 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -1,27 +1,21 @@ -name: GitHub Actions Demo +name: Validate duplicate entries on: [push] jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest steps: - - run: | - sudo apt-get update && sudo apt-get -y install jq git -# git clone https://github.com/tldrrun/tools.tldr.run -# cd tools.tldr.run/tools -# cat *.json | jq '.name' - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - run: echo "Wow ${{ github.base_ref }} - ${{ github.head_ref }}" - - run: | + - run: sudo apt-get update && sudo apt-get -y install jq git + - name: Validate duplicate tool names + run: | git clone https://github.com/${{ github.repository }} -b `echo ${{ github.ref }} | cut -d'/' -f3` - cd tools.tldr.run - git checkout main && git fetch - git diff --name-status main..`echo ${{ github.ref }} | cut -d'/' -f3` -# - name: Check out repository code -# uses: actions/checkout@v2 -# - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." + cd tools.tldr.run/tools + echo "Total entries = " $(cat *.json | jq '.name' | sort | wc -l) + echo "Unique entries = " $(cat *.json | jq '.name' | sort | uniq -i | wc -l) + if [ $(cat *.json | jq '.name' | sort | uniq -i | wc -l) -ne $(cat *.json | jq '.name' | sort | wc -l) ]; echo "Duplicate entries list"; cat *.json | jq '.name' | sort | uniq -i -c -d; then exit 1; fi - name: List files in the repository run: | ls ${{ github.workspace }} From 2b995819dc64119634de599653248cce0746f07f Mon Sep 17 00:00:00 2001 From: Rewanth Tammana <22347290+rewanthtammana@users.noreply.github.com> Date: Sat, 14 Aug 2021 23:59:20 +0400 Subject: [PATCH 6/6] Delete test.json --- tools/test.json | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 tools/test.json diff --git a/tools/test.json b/tools/test.json deleted file mode 100644 index de2f8a2..0000000 --- a/tools/test.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Test", - "description": "Test description", - "tags": [ - "data-security", - "database-security", - "sql", - "sql-security", - "cryptography", - "firewall", - "sql-firewall", - "data-tokenization", - "data-masking", - "encryption", - "blue-team", - "honeypot", - "canary-token", - "end-to-end-encryption" - ], - "operating_systems": [ - "linux", - "mac" - ], - "license": "Apache-2.0", - "availability": [ - "opensource", - "free", - "commercial" - ], - "github_url": "https://github.com/test/acra", - "url": "https://www.test.com/acra/" -}