我希望在合并请求被合并后触发我的GitHub CI,因为我想在GitHub中的合并请求合并后将我的源代码从GitHub发送到gitlab。CI会在创建拉取请求时触发,但在合并后不会触发CI,因此我无法将源代码从GitHub发送到gitlab。示例-https://github.com/kumaresan-subramani/ej2-blaz-doc/pull/7。
我的yml文件:
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [opened, closed]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: set environment variables
uses: allenevans/set-env@v1.0.0
with:
MY_ENV_VAR: 'my value'
GIT_USER: ${{ secrets.USER }}
GIT_TOKEN: ${{ secrets.TOKEN }}
- name: Install
run: npm i
- name: Publish
run: npm run publish
if: github.event.pull_request.merged == 'true'
types: [closed]
,它对我来说无法正常工作。查看文档后,它还指出:“默认情况下,仅当 pull_request 事件的活动类型为 opened、synchronize 或 reopened 时,工作流才会运行。”https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request - Beolap