Skip to content

Commit

Permalink
ci: add version check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
beliven-fabrizio-gortani committed Dec 29, 2024
1 parent c436218 commit 0898678
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check Version in Script

on:
release:
types:
- published

jobs:
verify-version:
runs-on: ubuntu-latest

steps:
# Checkout del repository
- name: Checkout repository
uses: actions/checkout@v3

# Estrai la versione dal tag
- name: Extract version from tag
id: extract_tag
run: echo "TAG_VERSION=${GITHUB_REF_NAME#refs/tags/}" >> $GITHUB_ENV

# Controlla la versione nello script
- name: Verify script version matches tag
id: check_version
run: |
# Estrai la versione dallo script
SCRIPT_VERSION=$(grep '^VERSION=' laravel-sync | cut -d'"' -f2)
# Confronta le versioni
if [ "$SCRIPT_VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch: Script VERSION=$SCRIPT_VERSION, Tag VERSION=$TAG_VERSION"
exit 1
fi
echo "Script version matches tag version: $SCRIPT_VERSION"
# Passaggio opzionale per notificare il successo (puoi personalizzarlo o eliminarlo)
- name: Notify success
if: success()
run: echo "Version check passed successfully!"
4 changes: 2 additions & 2 deletions laravel-sync
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# Version
# The version number will be replaced by the CI/CD pipeline
VERSION="undefined"
# Remember to update the version in this file
VERSION="1.3.0"

# Flags
IGNORE_DATABASE=false
Expand Down

0 comments on commit 0898678

Please sign in to comment.