Skip to content

Commit 6cabeb7

Browse files
committed
Use peter-evans/create-pull-request instead of repo-sync/pull-request
1 parent 2ab0558 commit 6cabeb7

File tree

1 file changed

+8
-40
lines changed

1 file changed

+8
-40
lines changed

.github/workflows/update-framework.yml

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -46,49 +46,17 @@ jobs:
4646
# Bust the cache at least once a month - output format: YYYY-MM.
4747
custom-cache-suffix: $(date -u "+%Y-%m")
4848

49-
- name: Configure git user
50-
run: |
51-
git config --global user.email "info@wp-cli.org"
52-
git config --global user.name "wp-make-coffee"
53-
54-
- name: Check if remote branch exists
55-
run: echo "REMOTE_BRANCH_EXISTS=$([[ -z $(git ls-remote --heads origin update-framework) ]] && echo "0" || echo "1")" >> $GITHUB_ENV
56-
57-
- name: Create branch to base pull request on
58-
if: env.REMOTE_BRANCH_EXISTS == 0
59-
run: |
60-
git checkout -b update-framework
61-
62-
- name: Fetch existing branch to add commits to
63-
if: env.REMOTE_BRANCH_EXISTS == 1
64-
run: |
65-
git fetch --all --prune
66-
git checkout update-framework
67-
git pull --no-rebase
68-
6949
- name: Update wp-cli framework
7050
run: |
7151
composer update wp-cli/wp-cli --with-all-dependencies
7252
73-
- name: Check if there are changes
74-
run: echo "CHANGES_DETECTED=$([[ -z $(git status --porcelain) ]] && echo "0" || echo "1")" >> $GITHUB_ENV
75-
76-
- name: Commit changes
77-
if: env.CHANGES_DETECTED == 1
78-
run: |
79-
git add composer.lock
80-
git commit -m "Update wp-cli framework - $(date +'%Y-%m-%d')"
81-
git push origin update-framework
82-
8353
- name: Create pull request
84-
if: |
85-
env.CHANGES_DETECTED == 1 &&
86-
env.REMOTE_BRANCH_EXISTS == 0
87-
uses: repo-sync/pull-request@v2
54+
uses: peter-evans/create-pull-request@v7
8855
with:
89-
source_branch: update-framework
90-
destination_branch: ${{ github.event.repository.default_branch }}
91-
github_token: ${{ secrets.ACTIONS_BOT }}
92-
pr_title: Update wp-cli framework
93-
pr_body: "**This is an automated pull-request**\n\nUpdates the `wp-cli/wp-cli` framework to the latest changeset."
94-
pr_label: scope:framework
56+
branch: update-framework
57+
base: ${{ github.event.repository.default_branch }}
58+
token: ${{ secrets.ACTIONS_BOT }}
59+
title: Update wp-cli framework
60+
body: "**This is an automated pull-request**\n\nUpdates the `wp-cli/wp-cli` framework to the latest changeset."
61+
labels: scope:framework
62+
commit-message: "Update wp-cli framework"

0 commit comments

Comments
 (0)