Skip to content

Commit

Permalink
publish.mjs: git called as /usr/bin/git
Browse files Browse the repository at this point in the history
  • Loading branch information
robzan8 committed Sep 5, 2023
1 parent 1eacf6c commit 88732c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -52,11 +53,7 @@ jobs:
#if: github.ref == 'refs/heads/main' # Cambia questo in base al tuo branch predefinito
#run: ./scripts/jenkins/publish-snapshots.sh

- name: Get Latest Tag
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
LATEST_TAG: ${{ steps.vars.outputs.tag }}
run: ./scripts/publish.mjs
2 changes: 1 addition & 1 deletion scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const publish = async () => {
shell.exit(1);
}
const nmpRc = `//registry.npmjs.org/:_authToken=${npmToken}`;
const curTag = process.env.LATEST_TAG;
const curTag = shell.exec(`/usr/bin/git describe --abbrev=0 --tags --exact-match 2> /dev/null`, {silent: true}).stdout;
if (curTag == null || curTag.length === 0) {
shell.echo('No version tag defined');
shell.exit(0);
Expand Down

0 comments on commit 88732c1

Please sign in to comment.