Skip to content

Commit e163234

Browse files
committed
ci: run release drafter on pull requests
1 parent 55d47ac commit e163234

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/publish-attested.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ jobs:
6464
with:
6565
subject-path: dist/*.nupkg
6666

67-
- name: Create or update draft release
67+
- name: Upload artifacts to release
68+
if: ${{ inputs.version != '' }}
6869
env:
6970
GITHUB_TOKEN: ${{ github.token }}
7071
REPOSITORY: ${{ github.repository }}
7172
DIST_DIR: dist
72-
FIND_DRAFT: "true"
73-
ENSURE_DRAFT: "true"
74-
FAIL_MESSAGE: "No draft release found. Release Drafter must create the draft before artifacts can be uploaded."
73+
RELEASE_TAG: ${{ inputs.version }}
7574
ASSET_PATTERNS: |
7675
*
7776
run: python3 -m scripts.releases.upload_release_assets
77+
78+
- name: Skip release upload
79+
if: ${{ inputs.version == '' }}
80+
run: echo "No version supplied; attested artifacts were produced without release upload."

.github/workflows/release-drafter.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Release Drafter
22

33
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, closed]
46
workflow_dispatch:
57
inputs:
68
version:
@@ -34,6 +36,7 @@ jobs:
3436
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3537

3638
publish-attested:
39+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.merged }}
3740
needs: update-release-draft
3841
uses: ./.github/workflows/publish-attested.yml
3942
with:

0 commit comments

Comments
 (0)