Copier Update #5
This file contains 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: 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 }}" |