Skip to content

Commit

Permalink
Merge pull request #20 from ayekaunic/QC-20-Update-Version-Check
Browse files Browse the repository at this point in the history
QC-20: Update 'Version Check'
  • Loading branch information
ayekaunic authored Aug 25, 2024
2 parents d11dec7 + e89d2f4 commit 348724f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/lint-and-version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Flutter Lint and Version Check
on:
pull_request:
branches: [ "develop" ]
types: [opened, edited, synchronize]

jobs:
lint-and-version-check:
Expand All @@ -26,10 +27,25 @@ jobs:
cd app
flutter analyze
- name: Check for skip-version-check label
id: label_check
run: |
labels=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
| jq -r '.[].name')
if echo "$labels" | grep -q "skip-version-check"; then
echo "SKIP_VERSION_BUMP=true" >> $GITHUB_ENV
else
echo "SKIP_VERSION_BUMP=false" >> $GITHUB_ENV
fi
- name: Check Version Bump
if: env.SKIP_VERSION_BUMP == 'false'
run: |
cd app
PREV_VERSION=$(git show HEAD^:pubspec.yaml | grep '^version:' | awk '{print $2}')
git fetch origin develop
PREV_VERSION=$(git show origin/develop:pubspec.yaml | grep '^version:' | awk '{print $2}')
CURR_VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}')
if [ "$PREV_VERSION" == "$CURR_VERSION" ]; then
echo "Version has not been bumped. Failing the workflow."
Expand Down

0 comments on commit 348724f

Please sign in to comment.