Skip to content

Commit

Permalink
Update automerge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Oct 24, 2023
1 parent 15c7399 commit 7dce769
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,25 @@ permissions:
jobs:
automerge:
runs-on: ubuntu-latest
# Run only if PR is inside JabRef's main repository and created by dependabot or by an update workflow
if: >
(github.repository == 'JabRef/jabref') &&
(github.event.pull_request.head.repo.full_name == 'JabRef/jabref') &&
(
(github.actor == 'dependabot[bot]') ||
(
startsWith(github.event.pull_request.title, '[Bot] ') ||
startsWith(github.event.pull_request.title, 'Bump ') ||
startsWith(github.event.pull_request.title, 'New Crowdin updates')
)
)
steps:
- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}}
- name: Merge PR
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}}
- name: Check repository
run: |
if [[ "${{ github.repository }}" != 'JabRef/jabref' ]]; then
echo "Incorrect repository"
exit 1
fi
- name: Check PR source repository
run: |
if [[ "${{ github.event.pull_request.head.repo.full_name }}" != 'JabRef/jabref' ]]; then
echo "PR is not from JabRef/jabref repository"
exit 1
fi
- name: Check actor and PR title
run: |
if [[ "${{ github.actor }}" != 'dependabot[bot]' ]] && \
[[ "${{ github.event.pull_request.title }}" != '[Bot] '* ]] && \
[[ "${{ github.event.pull_request.title }}" != 'Bump '* ]] && \
[[ "${{ github.event.pull_request.title }}" != 'New Crowdin updates'* ]]; then
echo "Actor or PR title condition not met"
exit 1
fi

0 comments on commit 7dce769

Please sign in to comment.