Skip to content

Commit

Permalink
additional pr wf checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pirafrank committed May 6, 2024
1 parent ed64d8f commit a15acb3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set .nvmrc content to stage output
id: nvmrc
Expand All @@ -32,6 +34,17 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Check git tag for version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "Current version in package.json: $PACKAGE_VERSION"
if git rev-parse "${PACKAGE_VERSION}" >/dev/null 2>&1; then
echo "Error: git tag ${PACKAGE_VERSION} already exists."
exit 1
else
echo "Good: no matching git tag exists for version ${PACKAGE_VERSION}"
fi
- name: Run tests
run: npm run test
env:
Expand Down
11 changes: 10 additions & 1 deletion test.docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ docker run --rm \
github-graphql-client:latest "-v"

# commands below need GITHUB_TOKEN to be set.
source .env.sh
if [[ -f .env.sh ]]; then
echo "Sourcing .env.sh file"
source .env.sh
elif [[ ! -z "$GITHUB_TOKEN" ]]; then
echo "No .env.sh file set, reading GITHUB_TOKEN from environment"
exit 1
else
echo "GITHUB_TOKEN not set and .env.sh does not exist. Exiting..."
exit 1
fi

echo "************ branch arg missing *******************"

Expand Down

0 comments on commit a15acb3

Please sign in to comment.