diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae5ae286..e8192ea9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,90 +9,29 @@ env: CI_CHECK_FAIL: ssh2 jobs: - tests-linux: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - node-version: [10.16.0, 10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x] + build: + runs-on: self-hosted + steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - name: Check Node.js version - run: node -pe process.versions - - name: Install Python 2.7 - if: ${{ matrix.node-version == '10.16.0' }} + + - name: Build Docker Image + run: docker build -t myapp:${{ github.sha }} . + + - name: Push Docker Image run: | - sudo apt install python2.7 - echo "PYTHON=$(which python2.7)" >> "$GITHUB_ENV" - - name: Install module - run: npm install - - name: Run tests - run: npm test - tests-macos: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - node-version: [16.x, 18.x, 20.x, 22.x] - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - name: Install Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Check Node.js version - run: node -pe process.versions - - name: Install module - run: npm install - - name: Run tests - run: npm test - tests-macos-homebrew: - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Use Node.js (latest) - run: brew install node - - name: Install Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Check Node.js version - run: node -pe process.versions - - name: Install module - run: npm install - - name: Run tests - run: npm test - tests-windows: - runs-on: windows-2019 - strategy: - fail-fast: false - matrix: - node-version: [16.x, 18.x, 20.x, 22.x] - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - name: Check Node.js version - run: node -pe process.versions - - name: Install module - run: npm install - - name: Run tests - run: npm test + echo ${{ secrets.DOCKER_PASSWORD }} | docker login tcss-agent.tencentcloudcr.com --username ${{ secrets.DOCKER_USERNAME }} --password-stdin + docker tag myapp:${{ github.sha }} tcss-agent.tencentcloudcr.com/tcss/zunlong:${{ github.sha }} + docker push tcss-agent.tencentcloudcr.com/tcss/zunlong:${{ github.sha }} + - name: Create issue if risk found + uses: actions/github-script@v7 + with: + script: | + const result = "123123123123123123"; + if (result && result.trim() !== "") { + github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: "CI/CD扫描发现风险", + body: result + }); + } diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index c21c0ad7..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: lint - -on: - pull_request: - push: - branches: [ master ] - -env: - NODE_VERSION: 18.x - -jobs: - lint-js: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Check Node.js version - run: node -pe process.versions - - name: Install ESLint + ESLint configs/plugins - run: npm install --only=dev - - name: Lint files - run: npm run lint diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..21ce4dad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine +CMD echo "Hello, World!" diff --git a/README.md b/README.md index d0e6f7fc..3de51e9f 100644 --- a/README.md +++ b/README.md @@ -889,7 +889,7 @@ You can find more examples in the `examples` directory of this repository. ```js { - type: 'password' + type: 'password', username: 'foo', password: 'bar', } @@ -897,7 +897,7 @@ You can find more examples in the `examples` directory of this repository. ```js { - type: 'publickey' + type: 'publickey', username: 'foo', // Can be a string, Buffer, or parsed key containing a private key key: ..., @@ -908,7 +908,7 @@ You can find more examples in the `examples` directory of this repository. ```js { - type: 'hostbased' + type: 'hostbased', username: 'foo', localHostname: 'baz', localUsername: 'quux', @@ -921,7 +921,7 @@ You can find more examples in the `examples` directory of this repository. ```js { - type: 'agent' + type: 'agent', username: 'foo', // Can be a string that is interpreted exactly like the `agent` // connection config option or can be a custom agent @@ -932,7 +932,7 @@ You can find more examples in the `examples` directory of this repository. ```js { - type: 'keyboard-interactive' + type: 'keyboard-interactive', username: 'foo', // This works exactly the same way as a 'keyboard-interactive' // Client event handler