Skip to content

Commit f642c6d

Browse files
committed
additional pr wf checks
1 parent ed64d8f commit f642c6d

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/pr.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
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
@@ -32,6 +34,17 @@ jobs:
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:

test.docker.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ docker run --rm \
2121
github-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

2634
echo "************ branch arg missing *******************"
2735

0 commit comments

Comments
 (0)