Skip to content
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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ updates:
- "*"
labels:
- no-changelog-entry-needed
commit-message:
prefix: "[dependabot]"
cooldown:
default-days: 7
2 changes: 2 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ changelog:
- dependabot
- pre-commit-ci
- github-actions
- mne-bot
- mne[bot]
14 changes: 7 additions & 7 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Bot auto-merge
on: pull_request # yamllint disable-line rule:truthy
on: pull_request_target # yamllint disable-line rule:truthy

permissions:
contents: write
pull-requests: write

jobs:
autobot:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
# Names can be found with gh api /repos/mne-tools/mne-python/pulls/12998 -q .user.login for example
if: (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'github-actions[bot]') && github.repository == 'mne-tools/mne-python'
if: (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]') && github.repository == 'mne-tools/mne-python'
steps:
- name: Enable auto-merge for bot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_TOKEN: ${{secrets.MNE_BOT_TOKEN}}
35 changes: 35 additions & 0 deletions .github/workflows/autopush.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bot auto-push
on: # yamllint disable-line rule:truthy
push:
branches:
- dependabot/**
- pre-commit-ci*

jobs:
autobot:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
persist-credentials: true
token: ${{ secrets.MNE_BOT_TOKEN }}
ssh-user: mne-bot
fetch-depth: 0
- name: Push a commit for bot PRs to run CircleCI
run: |
set -xeo pipefail
git config --global user.name "mne[bot]"
git config --global user.email "[email protected]"
COMMIT_MESSAGE=$(git show -s --format=%s)
# Detect dependabot and pre-commit.ci commit messages
if [[ "$COMMIT_MESSAGE" == '[dependabot]'* ]] || [[ "$COMMIT_MESSAGE" == '[pre-commit.ci]'* ]] ; then
echo "Pushed commit to run CircleCI for: $COMMIT_MESSAGE" | tee -a $GITHUB_STEP_SUMMARY
git commit --allow-empty -m "mne[bot] Push commit to run CircleCI"
git push
else
echo "No need to push a commit for: $COMMIT_MESSAGE" | tee -a $GITHUB_STEP_SUMMARY
fi
env:
GH_TOKEN: ${{ secrets.MNE_BOT_TOKEN }}
17 changes: 9 additions & 8 deletions .github/workflows/credit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
name: Update
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.MNE_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.MNE_BOT_TOKEN }}
steps:
- uses: actions/checkout@v5
with:
Expand All @@ -35,11 +35,12 @@ jobs:
- name: Create PR
run: |
set -xeo pipefail
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git checkout -b credit
git commit -am "MAINT: Update code credit"
git push origin credit
PR_NUM=$(gh pr create --base main --head credit --title "MAINT: Update code credit" --body "Created by credit [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }}). <br> <br> *Adjustments may need to be made to \`doc/changes/credit_tools.py\` or \`.mailmap\` etc. to get CircleCI to pass.*" --label "no-changelog-entry-needed")
git config --global user.email "[email protected]"
git config --global user.name "mne[bot]"
BRANCH=credit/$GITHUB_RUN_ID
git checkout -b $BRANCH
git commit -am "mne[bot]: Update code credit"
git push origin $BRANCH
PR_NUM=$(gh pr create --base main --head $BRANCH --title "MAINT: Update code credit" --body "Created by credit [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }}). <br> <br> *Adjustments may need to be made to \`doc/changes/credit_tools.py\` or \`.mailmap\` etc. to get CircleCI to pass.*" --label "no-changelog-entry-needed")
echo "Opened https://github.com/mne-tools/mne-python/pull/${PR_NUM}" >> $GITHUB_STEP_SUMMARY
if: steps.status.outputs.dirty == 'true'
10 changes: 5 additions & 5 deletions .github/workflows/spec_zero.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
name: Update dependency versions
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.MNE_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.MNE_BOT_TOKEN }}
steps:
- uses: actions/checkout@v5
with:
Expand Down Expand Up @@ -52,10 +52,10 @@ jobs:
- name: Create PR
run: |
set -xeo pipefail
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git config --global user.email "50266005+mne-[email protected]"
git config --global user.name "mne[bot]"
git checkout -b spec_zero
git commit -am "MAINT: Update dependency specifiers"
git commit -am "mne[bot]: Update dependency specifiers"
git push origin spec_zero
PR_NUM=$(gh pr create --base main --head spec_zero --title "MAINT: Update dependency specifiers" --body "Created by spec_zero [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }}). <br> <br> *Adjustments may need to be made to shims in \`mne/fixes.py\` in this or another PR. \`git grep TODO VERSION\` is a good starting point for finding potential updates.*" --label "no-changelog-entry-needed")
echo "Opened https://github.com/mne-tools/mne-python/pull/${PR_NUM}" >> $GITHUB_STEP_SUMMARY
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ repos:
hooks:
- id: zizmor
args: [--fix]
# We correctly use pull_request_trigger, and need Zizmor 2.0+ to configure the ignore
exclude: ^.github/workflows/automerge.yml

# these should *not* be run on CIs:
ci:
Expand Down
Loading