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

Use npm list to get the version of elastic-apm-node #228

Merged
merged 1 commit into from
Apr 26, 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
13 changes: 10 additions & 3 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # also fetch tags
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies # This is needed to be able to run the npm list command
run: npm ci
- run: |
ELASTIC_APM_NODE_VERSION="v$(jq -r '.dependencies."elastic-apm-node".version' package-lock.json)"
ELASTIC_APM_NODE_VERSION=$(npm list --depth 0 --json elastic-apm-node | jq -r '.dependencies."elastic-apm-node".version')
ELASTIC_APM_NODE_VERSION_WITH_PREFIX="v${ELASTIC_APM_NODE_VERSION}"
# if the tag does not exist
if [[ ! $(git tag -l "${ELASTIC_APM_NODE_VERSION}") ]]; then
if [[ ! $(git tag -l "${ELASTIC_APM_NODE_VERSION_WITH_PREFIX}") ]]; then
git tag ${ELASTIC_APM_NODE_VERSION}
git push origin "refs/tags/${ELASTIC_APM_NODE_VERSION}"
git push origin "refs/tags/${ELASTIC_APM_NODE_VERSION_WITH_PREFIX}"
fi