File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1818 steps :
1919 - name : Clone repo
2020 uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0
2123
2224 - name : Set .nvmrc content to stage output
2325 id : nvmrc
3234 - name : Install dependencies
3335 run : npm ci
3436
37+ - name : Check git tag for version
38+ run : |
39+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
40+ echo "Current version in package.json: $PACKAGE_VERSION"
41+ if git rev-parse "${PACKAGE_VERSION}" >/dev/null 2>&1; then
42+ echo "Error: git tag ${PACKAGE_VERSION} already exists."
43+ exit 1
44+ else
45+ echo "Good: no matching git tag exists for version ${PACKAGE_VERSION}"
46+ fi
47+
3548 - name : Run tests
3649 run : npm run test
3750 env :
Original file line number Diff line number Diff line change @@ -21,7 +21,15 @@ docker run --rm \
2121github-graphql-client:latest " -v"
2222
2323# commands below need GITHUB_TOKEN to be set.
24- source .env.sh
24+ if [[ -f .env.sh ]]; then
25+ echo " Sourcing .env.sh file"
26+ source .env.sh
27+ elif [[ ! -z " $GITHUB_TOKEN " ]]; then
28+ echo " No .env.sh file set, reading GITHUB_TOKEN from environment"
29+ else
30+ echo " GITHUB_TOKEN not set and .env.sh does not exist. Exiting..."
31+ exit 1
32+ fi
2533
2634echo " ************ branch arg missing *******************"
2735
You can’t perform that action at this time.
0 commit comments