chore(deps): ⬆️ bump word-wrap from 1.2.3 to 1.2.4 #456
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'enhance deps PR' | |
on: | |
pull_request_target: | |
types: [labeled] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
run: | |
name: enhance deps PR | |
runs-on: ubuntu-latest | |
if: contains(github.event.pull_request.labels.*.name, 'dependencies') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Echo PR information | |
run: | | |
echo "[info] PR number: ${{ github.event.pull_request.number }}" | |
echo "[info] PR title: ${{ github.event.pull_request.title }}" | |
echo "[info] head ref: ${{ github.head_ref }}" | |
- name: Check PR context | |
id: check | |
run: | | |
echo "${{ github.event.pull_request.title }}" | \ | |
sed -e "s/^chore.*: \(.*\)/\1/" | \ | |
sed -e "s/^/chore(deps): ⬆️ /" | \ | |
xargs -I% echo "title=%" >> $GITHUB_OUTPUT | |
git log --pretty=format:"%b" -1 | \ | |
xargs -I% echo "body=%" >> $GITHUB_OUTPUT | |
- name: Enhance PR title | |
env: | |
number: ${{ github.event.pull_request.number }} | |
title: ${{ steps.check.outputs.title }} | |
run: | | |
gh pr edit ${{ env.number }} --title "${{ env.title }}" | |
- name: Enhance PR commit message | |
env: | |
number: ${{ github.event.pull_request.number }} | |
title: ${{ steps.check.outputs.title }} | |
body: ${{ steps.check.outputs.body }} | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git commit --amend -m "${{ env.title }}" -m "${{ env.body }}" | |
git push -f |