Skip to content

Commit a5f0920

Browse files
authored
Merge pull request #7370 from ampproject/update/gutenberg-packages-workflow
Update Git user and add PR body in Gutenberg packages workflow
2 parents 021bf38 + 269a8cc commit a5f0920

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/gutenberg-packages-update.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ jobs:
113113

114114
- name: Configure git user
115115
run: |
116-
git config user.email "[email protected]"
117-
git config user.name "Pierre Gordon"
116+
git config user.name ${{ secrets.GIT_USER }}
117+
git config user.email ${{ secrets.GIT_USER_EMAIL }}
118118
119119
- name: Check if remote branch exists
120120
id: remote-branch
@@ -167,11 +167,22 @@ jobs:
167167
- name: Create pull request
168168
if: steps.packages.outputs.list != 0 && steps.remote-branch.outputs.exists == 0
169169
run: |
170-
git push -u origin "$HEAD_BRANCH"
171-
PR_URL=$(gh pr create --base "$BASE_BRANCH" --title "Update Gutenberg packages after v$VERSION release" --body "" --label dependencies | grep https://)
170+
NPM_URL="https://www.npmjs.com/package"
171+
BODY="**Following packages were updated:**"
172+
for PACKAGE in $PACKAGES; do
173+
PACKAGE_SLUG=$(echo $PACKAGE | sed 's/@/\/v\//2')
174+
BODY="$BODY
175+
176+
- [$PACKAGE]($NPM_URL/$PACKAGE_SLUG)"
177+
done
178+
179+
echo ${BODY//$'\n'/'%0A'}
180+
181+
PR_URL=$(gh pr create --base "$BASE_BRANCH" --title "Update Gutenberg packages after v$VERSION release" --body "$BODY" --label dependencies | grep https://)
172182
gh pr merge --auto --merge "$PR_URL"
173183
env:
174184
VERSION: ${{ needs.check-gutenberg-release.outputs.latest-version }}
175185
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
176186
BASE_BRANCH: ${{ steps.branches.outputs.base }}
177187
HEAD_BRANCH: ${{ steps.branches.outputs.head }}
188+
PACKAGES: ${{ steps.packages.outputs.list }}

0 commit comments

Comments
 (0)