當我從拉取請求合并到主分支時,我將如何檢查在拉取請求上添加的標簽。我嘗試使用以下但沒有奏效:
name: Publish
on:
push:
branches:
- main
jobs:
Publish:
runs-on: ubuntu-latest
steps:
if: ${{github.event.label.name == 'release'}}
.......
uj5u.com熱心網友回復:
像這樣怎么樣?
name: Create Release
on:
pull_request:
branches:
- main
types:
- closed
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') # detect when pull request is merged since there's no merged event.
steps:
- name: Create release
...
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/520043.html
