这是indexloc提供的服务,不要输入任何密码
Skip to content

Fix steps conditions and add rtBot user #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,29 @@ jobs:
uses: actions/checkout@v3

- name: Approve and merge the PR
if: >
contains( github.event.workflow_run.head_commit.message, 'version-update:semver-minor' ) || contains( github.event.workflow_run.head_commit.message, 'version-update:semver-patch' )
run: |
gh pr merge "$PR_NUMBER" --auto --merge --delete-branch
if: |
contains( github.event.workflow_run.head_commit.message, 'version-update:semver-minor' ) ||
contains( github.event.workflow_run.head_commit.message, 'version-update:semver-patch' )
run: gh pr merge "$PR_NUMBER" --auto --merge --delete-branch
env:
PR_NUMBER: ${{github.event.workflow_run.pull_requests[0].number}}
GITHUB_TOKEN: ${{secrets.GH_BOT_TOKEN}}

gutenberg-packages:
name: Gutenberg packages update PR auto-merge
runs-on: ubuntu-latest
if: >
( startsWith(github.event.workflow_run.head_commit.message, 'Update WordPress NPM packages based on Gutenberg release') && endsWith(github.event.workflow_run.head_commit.message, 'github-actions <github-actions@github.com>') ) && ( ${{ github.event.workflow_run.head_commit.author.name }} == 'github-actions' && ${{ github.event.workflow_run.head_commit.author.email }} == 'github-actions@github.com' )
if: ${{ github.actor == 'rtBot' }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Approve and merge the PR
run: |
gh pr merge "$PR_NUMBER" --auto --merge --delete-branch
if: |
startsWith(github.event.workflow_run.head_commit.message, 'Update WordPress NPM packages based on Gutenberg release') &&
endsWith(github.event.workflow_run.head_commit.message, format('{0} {1}', 'rtBot', '<43742164+rtBot@users.noreply.github.com>')) &&
github.event.workflow_run.head_commit.author.name == 'rtBot' &&
github.event.workflow_run.head_commit.author.email == '43742164+rtBot@users.noreply.github.com'
run: gh pr merge "$PR_NUMBER" --auto --merge --delete-branch
env:
PR_NUMBER: ${{github.event.workflow_run.pull_requests[0].number}}
GITHUB_TOKEN: ${{secrets.GH_BOT_TOKEN}}
7 changes: 4 additions & 3 deletions .github/workflows/gutenberg-packages-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ jobs:

- name: Configure git user
run: |
git config user.name ${{ secrets.AUTHOR_NAME }}
git config user.email ${{ secrets.AUTHOR_EMAIL }}
git config user.name rtBot
git config user.email '43742164+rtBot@users.noreply.github.com'
- name: Check if remote branch exists
id: remote-branch
run: echo ::set-output name=exists::$([[ -z $(git ls-remote --heads origin "$HEAD_BRANCH" ) ]] && echo "0" || echo "1")
Expand Down Expand Up @@ -179,7 +179,8 @@ jobs:
- name: Add PR reviewers
if: steps.pr-create.outputs.pr-url != ''
# Add a PR reviewer so that a notification can be sent to the concerned person.
run: gh pr edit "$PR_URL" --add-reviewer ${{ secrets.PR_REVIEWER }}
run: gh pr edit "$PR_URL" --add-reviewer "$REVIEWER_USERNAME"
env:
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
PR_URL: ${{ steps.pr-create.outputs.pr-url }}
REVIEWER_USERNAME: thelovekesh