From 4d7c3969b47a3435be2d540b7cc82aea01f7004f Mon Sep 17 00:00:00 2001 From: "x.yumoto.k" Date: Mon, 24 Jul 2023 17:53:45 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=B0=E4=BB=98=E3=81=91=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9FCommit=E3=81=AE=E7=B4=A0=E6=80=A7=E3=82=92?= =?UTF-8?q?=E7=A2=BA=E8=AA=8D=E3=81=99=E3=82=8Bstep=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- azure-pipelines.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9bcb42c..aef4571 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,8 +15,17 @@ jobs: - job: Build pool: vmImage: ubuntu-latest - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/stage-'), eq(variables['Build.SourceBranchName'], 'develop')) steps: + - checkout: self + - script: | + git fetch origin main:main + if git merge-base --is-ancestor $(Build.SourceVersion) main; then + echo "This commit is in the main branch." + else + echo "This commit is not in the main branch." + exit 1 + fi + displayName: 'タグが付けられたCommitがdevelopブランチに存在するか確認' - script: echo Checked out $(Build.SourceVersion) tagged with $(Build.SourceBranch) displayName: "Run a one-line script"