Skip to content

Commit

Permalink
Update github-actions-demo.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rewanthtammana authored Aug 14, 2021
1 parent 39c3459 commit 809f8d3
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down

0 comments on commit 809f8d3

Please sign in to comment.