File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 uses : actions/checkout@v4
1818 with :
1919 fetch-depth : 0
20+ - name : Verify version matches release tag
21+ run : bin/check-version
2022 - name : WordPress Plugin Deploy
2123 id : deploy
2224 uses : tinify/action-wordpress-plugin-deploy@stable
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # Script assumes release tags are formatted as MAJOR.MINOR.PATCH
5+
6+ # https://docs.github.com/en/actions/reference/workflows-and-actions/variables
7+ # For workflows triggered by release, this is the release tag created.
8+ TAG_VERSION=" ${1:- ${GITHUB_REF# refs/ tags/ } } "
9+
10+ # Stable tag from readme.txt
11+ README_VERSION=$( grep -m 1 " ^Stable tag:" readme.txt | awk ' {print $3}' )
12+
13+ if [ " $TAG_VERSION " != " $README_VERSION " ]; then
14+ echo " Error: Tag: $TAG_VERSION , readme.txt: $README_VERSION "
15+ exit 1
16+ fi
17+
18+ echo " Version matches git release"
You can’t perform that action at this time.
0 commit comments