Skip to content

Commit

Permalink
ci: Check
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 committed Dec 26, 2023
1 parent 10da0fd commit 7f19bb9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
yaml:
name: Check projects.yaml
runs-on: ubuntu-latest
steps:
- name: Fetch projects.yaml
uses: actions/checkout@v4
with:
sparse-checkout: |
projects.yaml
sparse-checkout-cone-mode: false
- name: Get names
uses: mikefarah/yq@master
id: projects-names
with:
cmd: yq '.projects.[] | line + " " + .name' projects.yaml
- name: Make sure names are unique
run: |
duplicates=$(echo "${{ steps.projects-names.outputs.result }}" | sort --key 2 | uniq --skip-fields=1 --all-repeated)
if [ -n "$duplicates" ]; then
echo "# Some projects' names are duplicate" >> $GITHUB_STEP_SUMMARY
echo '```\n' "$duplicates" '\n```' >> $GITHUB_STEP_SUMMARY
exit 1
fi

0 comments on commit 7f19bb9

Please sign in to comment.