Skip to content

Commit a0a3fd6

Browse files
authored
ci: only run publish if pr title matches keywords (#491)
1 parent cdb7b8f commit a0a3fd6

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
pull-requests: write
1313

1414
jobs:
15-
publish:
15+
release-please:
1616
runs-on: ubuntu-latest
1717
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1818
name: "Bump version, create changelog and publish"
@@ -35,10 +35,6 @@ jobs:
3535
with:
3636
target-branch: ${{ github.ref_name }}
3737

38-
- uses: actions/checkout@v4
39-
with:
40-
fetch-depth: 0
41-
4238
- if: ${{ steps.release.outputs }}
4339
id: versions
4440
run: |
@@ -49,12 +45,36 @@ jobs:
4945
RELEASE_NAME="v$RELEASE_VERSION"
5046
RELEASE_CREATED='${{ steps.release.outputs.release_created }}'
5147
PRS_CREATED='${{ steps.release.outputs.prs_created }}'
48+
PR_TITLE='${{ github.event.workflow_run.head_commit.message }}'
5249
5350
echo "MAIN_RELEASE_VERSION=${MAIN_RELEASE_VERSION}" >> "${GITHUB_OUTPUT}"
5451
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "${GITHUB_OUTPUT}"
5552
echo "RELEASE_CREATED=${RELEASE_CREATED}" >> "${GITHUB_OUTPUT}"
56-
echo "PRS_CREATED=${PRS_CREATED}" >> "${GITHUB_OUTPUT}"
5753
echo "RELEASE_NAME=${RELEASE_NAME}" >> "${GITHUB_OUTPUT}"
54+
echo "PRS_CREATED=${PRS_CREATED}" >> "${GITHUB_OUTPUT}"
55+
echo "PR_TITLE=${PR_TITLE}" >> "${GITHUB_OUTPUT}"
56+
publish:
57+
needs: release-please
58+
runs-on: ubuntu-latest
59+
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_commit.message, 'chore(master)') }}
60+
name: "Bump version, create changelog and publish"
61+
environment:
62+
name: pypi
63+
url: https://pypi.org/p/postgrest
64+
steps:
65+
- name: Set up Python 3.11
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: 3.11
69+
70+
- name: Set up Poetry
71+
uses: abatilo/actions-poetry@v3
72+
with:
73+
poetry-version: 1.8.3
74+
75+
- uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 0
5878

5979
- name: Install dependencies
6080
run: poetry install

0 commit comments

Comments
 (0)