File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ publishing a partially rendered message.
6363
6464## Repository configuration
6565
66- The organization workflow template reads the optional repository variable
67- ` FIRST_MERGED_PR_MESSAGE ` . If it is absent, the installed workflow uses a
68- minimal generic message.
69-
70- A consumer can put its entire Markdown message in that single variable. For
71- example:
66+ The organization workflow template requires the repository Actions variable
67+ ` FIRST_MERGED_PR_MESSAGE ` . The workflow passes that variable directly to the
68+ action. If it is absent or empty, the action fails instead of publishing a
69+ fallback message.
70+
71+ Configure the variable under ** Settings → Secrets and variables → Actions →
72+ Variables** . A consumer can put its entire Markdown message in that single
73+ variable. For example:
7274
7375``` text
7476Thanks {contributor_mention}! Your first pull request to {repository_name} has been merged.
Original file line number Diff line number Diff line change @@ -230,8 +230,15 @@ def test_workflow_template_only_exposes_message_configuration(self) -> None:
230230 workflow = (
231231 ROOT / "workflow-templates" / "first-merged-pr-comment.yml"
232232 ).read_text (encoding = "utf-8" )
233- self .assertIn ("vars.FIRST_MERGED_PR_MESSAGE" , workflow )
234- self .assertIn ("message-template:" , workflow )
233+ self .assertIn (
234+ "message-template: ${{ vars.FIRST_MERGED_PR_MESSAGE }}" ,
235+ workflow ,
236+ )
237+ self .assertNotIn ("env:\n FIRST_MERGED_PR_MESSAGE" , workflow )
238+ self .assertNotIn (
239+ "Thanks {contributor_mention}! Your first pull request" ,
240+ workflow ,
241+ )
235242 self .assertNotIn ("survey" , workflow .lower ())
236243 self .assertNotIn ("community" , workflow .lower ())
237244 self .assertNotIn ("good first issue" , workflow .lower ())
Original file line number Diff line number Diff line change 3838 permissions :
3939 pull-requests : write
4040
41- env :
42- FIRST_MERGED_PR_MESSAGE : >-
43- ${{ vars.FIRST_MERGED_PR_MESSAGE ||
44- 'Thanks {contributor_mention}! Your first pull request to {repository_name} has been merged.' }}
45-
4641 steps :
4742 # pull_request_target is intentionally used without checkout. Nothing
4843 # from the pull request head is downloaded or executed.
5247 github-token : ${{ github.token }}
5348 pull-request-number : >-
5449 ${{ github.event.pull_request.number || inputs.pull_request_number }}
55- message-template : ${{ env .FIRST_MERGED_PR_MESSAGE }}
50+ message-template : ${{ vars .FIRST_MERGED_PR_MESSAGE }}
You can’t perform that action at this time.
0 commit comments