Skip to content

Commit 43065d1

Browse files
authored
Update ci.yml
Updating to use OIDC
1 parent 4ef6132 commit 43065d1

1 file changed

Lines changed: 7 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,10 @@ jobs:
6767

6868
- name: Publish to npm
6969
run: |
70-
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
71-
publish() { # use latest npm to ensure OIDC support
72-
npx -y npm@latest publish "$@"
73-
}
74-
if [[ ${GITHUB_REF} == *alpha* ]]; then
75-
publish --access public --tag alpha
76-
elif [[ ${GITHUB_REF} == *beta* ]]; then
77-
publish --access public --tag beta
78-
else
79-
PKG_NAME=$(node -p "require('./package.json').name")
80-
PKG_VERSION=$(node -p "require('./package.json').version")
81-
CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0")
82-
if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then
83-
echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})"
84-
publish --access public --tag backport
85-
else
86-
publish --access public
87-
fi
88-
fi
89-
env:
90-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
70+
if [[ ${GITHUB_REF} == *alpha* ]]; then
71+
npm publish --access public --tag alpha
72+
elif [[ ${GITHUB_REF} == *beta* ]]; then
73+
npm publish --access public --tag beta
74+
else
75+
npm publish --access public
76+
fi

0 commit comments

Comments
 (0)