Skip to content

Commit 1734012

Browse files
committed
Merge branch '@anchpop/autogenerate-sns-forum-post' into 'master'
Autogenerate SNS forum post See merge request dfinity-lab/public/ic!12522
2 parents 794fc5b + b6d3843 commit 1734012

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

testnet/tools/nns-tools/lib/proposals.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,38 @@ EOF
284284
echo "$OUTPUT"
285285
}
286286

287+
##: generate_forum_post_sns_wasm_publish
288+
## Usage: $1 <proposal_file> (<proposal_file>...)
289+
## Example: $1 directory_with_new_proposals/*
290+
## Example: $1 proposal_1.md proposal_2.md
291+
generate_forum_post_sns_wasm_publish() {
292+
PROPOSAL_FILES=$(ls "$@")
293+
294+
THIS_FRIDAY=$(date -d "next Friday" +'%Y-%m-%d' 2>/dev/null || date -v+Fri +%Y-%m-%d)
295+
296+
OUTPUT=$(
297+
cat <<EOF
298+
The NNS Team will be submitting the following proposals to publish new versions of SNS canisters to SNS-WASM this Friday, $THIS_FRIDAY. DFINITY plans to vote on these proposals the following Monday.
299+
300+
## Additional Notes / Breaking Changes
301+
302+
TODO - delete if nothing relevant
303+
304+
## Proposals to be Submitted
305+
306+
$(for file in $PROPOSAL_FILES; do
307+
echo "### $(sns_wasm_publish_proposal_canister_raw_name $file)"
308+
echo '````'
309+
cat $file
310+
echo '````'
311+
echo
312+
done)
313+
EOF
314+
)
315+
316+
echo "$OUTPUT"
317+
}
318+
287319
#### Helper functions
288320
encode_candid_args_in_file() {
289321
ARGS=$1
@@ -346,6 +378,10 @@ nns_upgrade_proposal_canister_raw_name() {
346378
cat "$FILE" | grep "## Proposal to Upgrade the" | cut -d' ' -f6
347379
}
348380

381+
sns_wasm_publish_proposal_canister_raw_name() {
382+
local FILE=$1
383+
cat "$FILE" | grep "## Proposal to Publish the SNS" | cut -d' ' -f7
384+
}
349385
#### Proposal text validators
350386

351387
validate_no_todos() {

0 commit comments

Comments
 (0)