-
Notifications
You must be signed in to change notification settings - Fork 11
52 lines (50 loc) · 1.74 KB
/
Copier.yml
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
name: Copier Update
on:
schedule:
- cron: 0 7 1/7 * *
workflow_dispatch:
jobs:
Copier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.COPIER_PAT }}
- uses: julia-actions/setup-julia@v1
with:
version: "1"
- name: Use Julia cache
uses: julia-actions/cache@v1
- name: Install JuliaFormatter.jl
run: julia -e 'using Pkg; pkg"add JuliaFormatter"'
- name: Setup Python
uses: actions/setup-python@v4
- name: Check for update in the template
run: |
pip install copier
copier update -A -o rej
echo -e "Automated changed by Copier.yml workflow\n" > /tmp/body.md
echo -e 'Rejected changes (if any):\n```diff\n' >> /tmp/body.md
find . -name "*.rej" | xargs cat >> /tmp/body.md
find . -name "*.rej" | xargs rm -f
echo -e '```' >> /tmp/body.md
git diff
- name: Run pre-commit to run the formatters
run: |
pip install pre-commit
pre-commit run -a || true # Ignore pre-commit errors
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.COPIER_PAT }}
commit-message: ":robot: COPIERTemplate.jl update"
title: "[AUTO] COPIERTemplate.jl update"
body-path: /tmp/body.md
branch: auto-copier-template-update
delete-branch: true
labels: configuration, automated pr, no changelog
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"