Skip to content

Commit 4f2f4da

Browse files
committed
fix: use github.run_number
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent 15afd53 commit 4f2f4da

4 files changed

Lines changed: 10 additions & 19 deletions

File tree

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
with:
2828
language: javascript
2929
repo-url: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
30-
commit-sha: ${{ github.event.workflow_run && github.event.workflow_run.head_sha || github.event.pull_request.head.sha || github.sha }}
30+
commit-sha: ${{ github.event.pull_request.head.sha || github.sha }}

.github/workflows/publish.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ jobs:
5858
# Remove both -ea. and -ea- formats for compatibility
5959
BASE_VERSION=$(echo "$VERSION" | sed -E 's/-ea[.-][0-9]+$//')
6060
echo "base-version=$BASE_VERSION" >> "$GITHUB_OUTPUT"
61-
echo "current-version=$VERSION" >> "$GITHUB_OUTPUT"
62-
63-
- name: Update package with EA version
64-
id: bump
65-
run: |
66-
EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea-${{ github.run_number }}"
67-
npm version "$EA_VERSION" --no-git-tag-version
68-
echo "version=$EA_VERSION" >> "$GITHUB_OUTPUT"
6961
7062
- name: Install project modules
7163
run: npm ci
@@ -74,14 +66,13 @@ jobs:
7466
run: npm run compile
7567

7668
- name: Publish package
77-
run: npm publish --verbose --tag ea --access public --provenance
78-
79-
- name: Commit and push package modifications
8069
run: |
81-
git add package.json
82-
git add package-lock.json
83-
git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]"
84-
git push
70+
EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea-${{ github.run_number }}"
71+
# Temporarily update version for publish
72+
npm version "$EA_VERSION" --no-git-tag-version
73+
npm publish --verbose --tag ea --access public --provenance
74+
# Restore original version
75+
npm version "${{ steps.current-version.outputs.base-version }}" --no-git-tag-version
8576
8677
publish-release:
8778
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trustify-da/trustify-da-javascript-client",
3-
"version": "0.2.4-ea.13",
3+
"version": "0.2.4",
44
"description": "Code-Ready Dependency Analytics JavaScript API.",
55
"license": "Apache-2.0",
66
"homepage": "https://github.com/guacsec/trustify-da-javascript-client#README.md",

0 commit comments

Comments
 (0)