Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

feat: make sure versions are kept in sync #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Check if versions are in sync
run: bash .github/workflows/keep_versions_synced.sh

- name: Install dependencies
run: pip install pre-commit

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/keep_versions_synced.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

version_package=$(grep '"prettier": "' package.json | sed -n 's/.*"prettier": "\(.*\)"/\1/p')
version_hook=$(grep '\- prettier@' .pre-commit-hooks.yaml | sed -n 's/.*prettier@\(.*\)/\1/p')


echo "Checking if versions in package.json and .pre-commit-hooks.yaml are in sync."

if [ "${version_package}" != "${version_hook}" ]; then
echo "They are out of sync, please resync them."
exit 1
else
echo "They are in sync."
fi