Skip to content

IDE>3.12时,报错String index out of range #392

IDE>3.12时,报错String index out of range

IDE>3.12时,报错String index out of range #392

Workflow file for this run

# 为了试验,此处作为单独的 Workflow,在实际工作中可 Install -> Lint、Test -> Preview 串行检验
name: Check PR
# 执行 CI 的时机: 当 git push 到 main分支时
on:
pull_request:
branches: main
permissions:
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check if commit is from CI
run: |
if [[ "${{ github.event.head_commit.committer.username }}" == "github-actions[bot]" ]]; then
echo "Commit is from CI, skipping the build..."
exit 78
else
echo "Commit is not from CI, continuing with the build..."
fi
- name: see vars
run: |
echo '${{github.event.pull_request.head.ref}}'
echo '${{github.event.pull_request.head.sha}}'
echo '${{github.event.pull_request.head.repo.branches_url}}'
echo '${{github.event.pull_request.head.repo.full_name}}'
echo '${{github.event.pull_request.base.ref}}'
echo '${{github.event.pull_request.base.sha}}'
echo '${{github.event.pull_request.base.repo.branches_url}}'
echo '${{github.event.pull_request.base.repo.full_name}}'
echo '${{github.head_ref}}'
echo '${{github.ref}}'
echo '${{github.ref_name}}'
echo '${{github.repository}}'
echo '${{ github.event.pull_request.number }}'
echo '${{ github.run_id }}'
echo '${{github.event.pull_request.user.name}}'
echo '${{github.event.pull_request.maintainer_can_modify}}'
echo '${{github.event.pull_request.user.id}}'
echo '${{github.event.sender.id}}'
echo '${{github.event.repository.fork}}'
echo '${{github.event.repository.name}}'
echo '${{github.event.repository.full_name}}'
echo '${{github.actor}}'
echo '${{github.triggering_actor}}'
echo '${{github.event.pull_request.user.name}}'
- name: Checkout
uses: actions/checkout/@v3
with:
fetch-depth: 1
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
git fetch --unshallow
env:
GITHUB_TOKEN: ${{ github.token}}
- name: see git1
run: |
git branch --show-current
- name: see git2
run: |
git diff --name-only origin/main...HEAD
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 16
- name: Install Dep
run: |
npm install
- name: Detect Pull Request Change
run: |
git config --global core.quotepath false
git config --global gui.encoding utf-8
git config --global i18n.commit.encoding utf-8
git config --global i18n.logoutputencoding utf-8
export LESSCHARSET=utf-8
npm run detectPR
{
echo "DIFF_STATE<<EOF"
echo "$(cat diff_stat.json)"
echo "EOF"
} >> "$GITHUB_ENV"
- name: Set up JDK 8
if: ${{fromJson(env.DIFF_STATE).needJAVA}}
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
- name: Install JDK Dependency
if: ${{fromJson(env.DIFF_STATE).needJAVA}}
run: |
mvn install:install-file -Dfile="demo_bjz_JiazhenBao/jar/nasl-metadata-maven-plugin-1.3.0/nasl-metadata-maven-plugin-1.3.0.jar" -DpomFile="demo_bjz_JiazhenBao/jar/nasl-metadata-maven-plugin-1.3.0/pom.xml"
mvn install:install-file -Dfile="demo_bjz_JiazhenBao/jar/nasl-metadata-maven-plugin-1.4.1/nasl-metadata-maven-plugin-1.4.1.jar" -DpomFile="demo_bjz_JiazhenBao/jar/nasl-metadata-maven-plugin-1.4.1/pom.xml"
mvn install:install-file -Dfile="demo_bjz_JiazhenBao/jar/nasl-metadata-maven-plugin-1.4.0/nasl-metadata-maven-plugin-1.4.0.jar" -DpomFile="demo_bjz_JiazhenBao/jar/nasl-metadata-maven-plugin-1.4.0/pom.xml"
mvn install:install-file -DgroupId=com.netease.lowcode -DartifactId=nasl-metadata-collector -Dversion=0.8.0 -Dpackaging=jar -Dfile="demo_bjz_JiazhenBao/jar/nasl-metadata-collector-0.8.0.jar"
- name: Install LCAP
run: |
npm install -g [email protected]
lcap config set platform https://defaulttenant.lcap.hadri.163yun.com
lcap config set username admin
lcap config set password Admin@123456
- name: Check Pull Request
run: |
npm run checkPR
{
echo 'CHECK_RESULT<<EOF'
echo $(cat pr_result.json)
echo EOF
} >> "$GITHUB_ENV"
env:
GITHUB_TOKEN: ${{ github.token}}
PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
HEAD_BRANCH_NAME: ${{github.head_ref}}
HEAD_REPOSITORY: ${{github.event.pull_request.head.repo.full_name}}
BASE_REPOSITORY: ${{github.event.pull_request.base.repo.full_name}}
GITHUB_REPOSITORY: ${{github.repository}}
ACTION_ID: ${{github.run_id}}
PR_EVENT_ACTION: ${{github.event.action}}
NOTIFY_CONFIG_JSON: ${{secrets.NOTIFY_CONFIG_JSON}}
- name: Upload PR Result Error
if: ${{fromJson(env.CHECK_RESULT).hasError}}
uses: actions/upload-artifact@v4
with:
name: pr_result
path: pr_result.json
- name: Exit If Error
if: ${{fromJson(env.CHECK_RESULT).hasError}}
run: |
exit 1
- name: Upload Assets
if: ${{fromJson(env.DIFF_STATE).packages[0]}}
uses: actions/upload-artifact@v4
id: upload_assets
with:
name: dist
path: dist/
- name: Append Assets Download url
if: ${{fromJson(env.DIFF_STATE).packages[0]}}
run: |
npm run successPR
env:
ARTIFACT_ID: ${{steps.upload_assets.outputs.artifact-id}}
GITHUB_TOKEN: ${{ github.token}}
PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
HEAD_BRANCH_NAME: ${{github.head_ref}}
HEAD_REPOSITORY: ${{github.event.pull_request.head.repo.full_name}}
BASE_REPOSITORY: ${{github.event.pull_request.base.repo.full_name}}
GITHUB_REPOSITORY: ${{github.repository}}
ACTION_ID: ${{github.run_id}}
- name: Upload PR Result Error
if: ${{fromJson(env.DIFF_STATE).packages[0]}}
uses: actions/upload-artifact@v4
with:
name: pr_result
path: pr_result.json