From a7eba8b00671d64f1464963d8de1719e18792da9 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:57:40 -0400 Subject: [PATCH] Release on push to `master` instead of on closed PRs targeting it. (#9544) This is safer than the prior approach, since it's safe by default: the release workflows never get triggered for non-merged PRs, so there's no possibility of a buggy conditional accidentally letting a workflow proceed when it shouldn't have. The only loss is that publishing no longer requires a `release` label on the merged PR that bumps the version. We can add a separate CI step that enforces that part as a condition for merging into `master`, if desirable. --- .github/workflows/_release.yml | 5 ++--- .github/workflows/langchain_experimental_release.yml | 6 ++---- .github/workflows/langchain_release.yml | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 6d8094d0679..e6ee3e6072d 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -13,9 +13,8 @@ env: jobs: if_release: - if: | - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'release') + # Disallow publishing from branches that aren't `master`. + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/langchain_experimental_release.yml b/.github/workflows/langchain_experimental_release.yml index a9706b2593b..90fee606d49 100644 --- a/.github/workflows/langchain_experimental_release.yml +++ b/.github/workflows/langchain_experimental_release.yml @@ -2,9 +2,7 @@ name: libs/experimental Release on: - pull_request: - types: - - closed + push: branches: - master paths: @@ -17,4 +15,4 @@ jobs: ./.github/workflows/_release.yml with: working-directory: libs/experimental - secrets: inherit \ No newline at end of file + secrets: inherit diff --git a/.github/workflows/langchain_release.yml b/.github/workflows/langchain_release.yml index d4941967b8c..6bafc6d2e97 100644 --- a/.github/workflows/langchain_release.yml +++ b/.github/workflows/langchain_release.yml @@ -2,9 +2,7 @@ name: libs/langchain Release on: - pull_request: - types: - - closed + push: branches: - master paths: @@ -17,4 +15,4 @@ jobs: ./.github/workflows/_release.yml with: working-directory: libs/langchain - secrets: inherit \ No newline at end of file + secrets: inherit