Skip to content

Commit ced7db1

Browse files
committed
Use dry run for release-plz release
1 parent 75901ea commit ced7db1

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

.github/workflows/release-plz.yml

+28-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- master
77

8+
env:
9+
RELEASE_PLZ_VERSION: "0.3.130"
10+
811
jobs:
912
release-plz-pr:
1013
permissions:
@@ -43,11 +46,32 @@ jobs:
4346
fetch-depth: 0
4447
- name: Install Rust toolchain
4548
uses: dtolnay/rust-toolchain@stable
49+
- name: Install binaries
50+
uses: taiki-e/install-action@v2
51+
with:
52+
tool: release-plz@${{env.RELEASE_PLZ_VERSION}}
4653
- name: Run release-plz
4754
id: release-plz
48-
uses: release-plz/[email protected]
49-
with:
50-
command: release --dry-run
55+
shell: bash
56+
# Modified from https://github.com/release-plz/action/blob/main/action.yml
57+
run: |
58+
release_output=$(release-plz release\
59+
--git-token "${GITHUB_TOKEN}"\
60+
--dry-run\
61+
-o json)
62+
echo "release_pr_output: $release_pr_output"
63+
prs=$(echo $release_pr_output | jq -c .prs)
64+
echo "prs=$prs" >> "$GITHUB_OUTPUT"
65+
prs_length=$(echo "$prs" | jq 'length')
66+
if [ "$prs_length" != "0" ]; then
67+
prs_created=true
68+
first_pr=$(echo $prs | jq -c .[0])
69+
else
70+
prs_created=false
71+
first_pr="{}"
72+
fi
73+
echo "pr=$first_pr" >> "$GITHUB_OUTPUT"
74+
echo "prs_created=$prs_created" >> "$GITHUB_OUTPUT"
5175
env:
5276
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5377
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
@@ -79,6 +103,7 @@ jobs:
79103
uses: release-plz/[email protected]
80104
with:
81105
command: release
106+
version: ${{env.RELEASE_PLZ_VERSION}}
82107
env:
83108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84109
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)