Replace isdir and numel==1 with isfolder and isscalar #98
Workflow file for this run
This file contains hidden or 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: Auto-merge Dependabot PRs | |
# adapted from https://jhale.dev/posts/auto-merging-prs/ | |
on: | |
pull_request: | |
pull_request_target: | |
branches: [main] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
dependabot: | |
runs-on: ubuntu-latest | |
steps: | |
- name: View PR author | |
run: echo "This PR is opened by '${{ github.event.pull_request.user.login }}'." | |
- name: Check if we skip auto-merging | |
id: check-skip | |
run: | | |
allow=${{ contains(fromJSON('["github-actions[bot]", "dependabot[bot]", "pre-commit-ci[bot]"]'), github.event.pull_request.user.login) }} && ${{ github.repository == 'bids-standard/bids-matlab' }} | |
if [ ${allow} == "true" ]; then | |
echo "auto merge allowed" | |
else | |
echo "auto merge not allowed" | |
fi; | |
echo "allow=${allow}" >> $GITHUB_OUTPUT | |
- name: Approve and enable auto-merge for bots | |
if: steps.check-skip.outputs.allow == 'true' | |
run: | | |
gh pr review --approve --body "auto-approved" "$PR_URL" | |
gh pr merge --auto --squash "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |