forked from nilearn/nilearn
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 2.45 KB
/
Copy pathsourcery.yml
File metadata and controls
70 lines (61 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
# Runs Sourcery refactoring on the entire codebase.
#
# If some potential refactoring are found it opens a pull-request.
#
# Requires a ``SOURCERY_TOKEN`` that can be obtained from
# logging into `the sourcery website <https://sourcery.ai/>`_
# with your github account.
#
###
name: Check codebase using Sourcery
on:
schedule:
# Uses the cron schedule for github actions
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
# Runs at 00:00, on day 1 of every 3rd month
- cron: 0 0 1 */3 *
# This enables manual triggering from GitHub UI
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
review-with-sourcery:
if: github.repository == 'nilearn/nilearn'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- uses: sourcery-ai/action@v1
id: sourcery
with:
token: ${{ secrets.SOURCERY_TOKEN }}
in_place: true
- name: Create issue
if: ${{ steps.sourcery.outcome != 'success' }}
uses: JasonEtco/create-an-issue@v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run_id: ${{ github.run_id }}
repository: ${{ github.repository }}
workflow_name: SOURCERY CHECK
with:
filename: .github/workflow_failure.md
update_existing: true
search_existing: open
- name: Return failure
if: ${{ steps.sourcery.outcome != 'success' }}
run: exit 1