Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version checking workflow #202

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/git-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: "Git tags"

on:
push:
tags:
- "v*"

permissions:
contents: "read"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
missing_tag:
name: "Tag without version bump"
runs-on: "ubuntu-latest"
steps:
-
name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"
extensions: "dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, fileinfo, exif"
-
name: "Checkout repository"
uses: "actions/checkout@v4"
with:
fetch-depth: 0
-
name: "Check latest tagged version"
run: |
LATEST_TAG="$(git describe --tags --abbrev=0)"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to send another PR with

LATEST_TAG="${{ github.ref_name }}"

CURRENT_VERSION="v$(php -r 'require __DIR__."/src/Root.php"; echo Cone\Root\Root::VERSION;')"
if [ "${LATEST_TAG}" != "${CURRENT_VERSION}" ]; then
echo "::error::Latest tag differs from current version"
exit 10
fi
Loading