Skip to content

Commit

Permalink
feat: Update version verification in checkout workflow
Browse files Browse the repository at this point in the history
This commit updates the `checkout.yml` workflow file to improve the version verification step. It modifies the commands to extract the version numbers from the `pubspec.yaml` and `pubspec.yaml.g.dart` files using the `grep` and `awk` commands. Additionally, it uses the `sed` command to remove any non-printable characters from the extracted version numbers. This ensures that the comparison between the two versions is accurate. The updated workflow now prints the version numbers and exits with a non-zero status code if they don't match.
  • Loading branch information
PlugFox committed Jul 17, 2024
1 parent 28e2ca9 commit 1ecb054
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ jobs:
- name: 👀 Verify versions
timeout-minutes: 1
run: |
version_pubspec=$(grep '^version:' pubspec.yaml | awk '{print $2}' | tr -d '[:space:]')
version_g_dart=$(grep 'representation: r' lib/src/model/pubspec.yaml.g.dart | awk -F"'" '{print $2}' | tr -d '[:space:]')
version_pubspec=$(grep '^version:' pubspec.yaml | awk '{print $2}' | sed 's/[^[:print:]]//g')
version_g_dart=$(grep 'representation: r' lib/src/model/pubspec.yaml.g.dart | awk -F"'" '{print $2}' | sed 's/[^[:print:]]//g')
echo "Version from pubspec.yaml: '$version_pubspec'"
echo "Version from pubspec.yaml.g.dart: '$version_g_dart'"
Expand Down

0 comments on commit 1ecb054

Please sign in to comment.