Skip to content

Commit a1b972f

Browse files
authored
Add a comment field, for when update-dependencies is triggered by others. (#661)
The update-dependencies workflow can be triggered by other projects (e.g. firebase-ios-sdk once firebase/firebase-ios-sdk#8654 goes in). This adds an optional comment that will be included in the created PR, to make it clear what triggered the update.
1 parent b17f8a3 commit a1b972f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/update-dependencies.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
baseBranch:
1515
description: 'create the new branch from this base'
1616
default: 'main'
17+
comment:
18+
description: 'optional comment to add to PR'
19+
default: ''
1720

1821
env:
1922
branchPrefix: "workflow/auto-update-deps-"
@@ -106,7 +109,14 @@ jobs:
106109
107110
date_str=$(date "+%a %b %d %Y")
108111
commit_title="Update ${CHOSEN_DEPS} dependencies - ${date_str}"
109-
commit_body="$(cat ${UPDATE_LOGFILE_PROCESSED})
112+
commit_body=
113+
if [[ -n '${{ github.event.inputs.comment }}' ]]; then
114+
# If a comment was provided, start with that instead of blank.
115+
commit_body='${{ github.event.inputs.comment }}
116+
117+
'
118+
fi
119+
commit_body="${commit_body}$(cat ${UPDATE_LOGFILE_PROCESSED})
110120
111121
> Created by [${{github.workflow}} workflow]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)."
112122
git config user.email "[email protected]"

0 commit comments

Comments
 (0)