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.
This commit is contained in:
Predrag Gruevski 2023-08-21 12:57:40 -04:00 committed by GitHub
parent d11841d760
commit a7eba8b006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 11 deletions

View File

@ -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:

View File

@ -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
secrets: inherit

View File

@ -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
secrets: inherit