NodeJS 每当我发出拉取请求时,新的更新都会直接发送到EC2示例

kq4fsx7k  于 2023-06-29  发布在  Node.js
关注(0)|答案(1)|浏览(88)

每当我提出pull request。我对存储库所做的所有更改都直接转到AWS上的EC2服务器,而无需批准
这就是我的node.js.yml文件的样子

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
  push:
    branches: [ "development" ]
  pull_request:
    branches: [ "development" ]

jobs: 
  build:
    runs-on: self-hosted
    steps:
    - uses: actions/checkout@v3
    # - run: fuser -k 4000/tcp & fuser -k 4001/tcp 
    - run: yarn install
    - run: yarn build
    - run: pm2 start ecosystem.config.js

我试着删除下面的两行,但它没有工作。

push:
    branches: [ "development" ]
zbdgwd5y

zbdgwd5y1#

你要做两件事:

on:
  # First change the target branch to main or uat
  # this will make sure that only push events to main or uat branch 
  # triggers a workflow instead of dev
  push:
    branches: [ "uat" ]
  # Second, remove the pull request trigger
  # Using push trigger for this simple case should suffice.
  # pull_request:
  #  branches: [ "development"]

相关问题