ci: used token for clone too and corrected npm pub
Some checks failed
CI / build-and-publish (push) Failing after 39s
Some checks failed
CI / build-and-publish (push) Failing after 39s
This commit is contained in:
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -16,6 +16,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
env:
|
||||||
ALPINE_MIRROR: ${{ secrets.ALPINE_MIRROR }}
|
ALPINE_MIRROR: ${{ secrets.ALPINE_MIRROR }}
|
||||||
|
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d'.' -f1-2) && \
|
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d'.' -f1-2) && \
|
||||||
@@ -24,8 +25,11 @@ jobs:
|
|||||||
apk update
|
apk update
|
||||||
apk add --no-cache git
|
apk add --no-cache git
|
||||||
|
|
||||||
GIT_URL="https://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git"
|
HOST="${GITHUB_SERVER_URL#https://}"
|
||||||
git clone --depth 1 --branch "$GITHUB_REF_NAME" "$GIT_URL" .
|
REPO="${{ github.repository }}"
|
||||||
|
AUTH_URL="https://${GITEA_TOKEN}@${HOST}/${REPO}.git"
|
||||||
|
|
||||||
|
git clone --depth 1 --branch "$GITHUB_REF_NAME" "$AUTH_URL" .
|
||||||
|
|
||||||
if [ "$(git rev-parse HEAD)" != "$GITHUB_SHA" ]; then
|
if [ "$(git rev-parse HEAD)" != "$GITHUB_SHA" ]; then
|
||||||
echo "Fetching exact commit $GITHUB_SHA..."
|
echo "Fetching exact commit $GITHUB_SHA..."
|
||||||
@@ -62,6 +66,4 @@ jobs:
|
|||||||
npm config set "//${HOST}/api/packages/${OWNER}/npm/:_authToken" "${GITEA_TOKEN}"
|
npm config set "//${HOST}/api/packages/${OWNER}/npm/:_authToken" "${GITEA_TOKEN}"
|
||||||
npm config set registry "${REGISTRY}"
|
npm config set registry "${REGISTRY}"
|
||||||
|
|
||||||
npm publish \
|
npm publish --ignore-scripts
|
||||||
--registry "https://${GITHUB_SERVER_URL#https://}/api/packages/${OWNER}/npm" \
|
|
||||||
--ignore-scripts
|
|
||||||
|
|||||||
Reference in New Issue
Block a user