[英]GitHub: How to find pull request(s) that will merge a particular branch name?
[英]Github Action that runs on Pull Request from a particular head branch, to a particular base branch
我想要一個 Github 操作在 Pull Request 上運行到特定的基本分支,但來自另一個特定的總分支。
name: Run production tests
on:
push:
pull_request:
branches:
- main
jobs: ...
但是,我特別希望在一個名為develop
的分支針對main
進行 PR 時運行類似的東西,而不僅僅是每次 PR 對main
進行 PR 時。
這樣的工作流程可能嗎? 我可能會錯過它,但我沒有看到在文檔中定位 head 分支的方法。
從文檔中,我找不到 head 分支的任何過濾器。 但這對於工作的if
條件是可行的。 例如
name: Run production tests
on:
pull_request:
branches:
- main
jobs:
build:
if: ${{ github.head_ref == 'develop'}}
runs-on: ubuntu-latest
steps:
- name: Run a multi-line script
run: |
echo "Do something here"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.