From 90a5ab1238a5d973c5067ed64f3fba031ef5a3e1 Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Fri, 22 Sep 2023 08:14:54 +0200 Subject: [PATCH] Fix compliance conflicts and show them on the body --- .github/workflows/Compliance.yml.jinja | 21 +++++++++++++++++---- .gitignore | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Compliance.yml.jinja b/.github/workflows/Compliance.yml.jinja index b70cd7f4..1533b4c0 100644 --- a/.github/workflows/Compliance.yml.jinja +++ b/.github/workflows/Compliance.yml.jinja @@ -15,20 +15,33 @@ jobs: - 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 pre-commit - copier update -A - pre-commit run -a + pip install copier + copier update -A -o rej + echo -e "Automated changed by Compliance.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 + 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@v3 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.COMPLIANCE_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 diff --git a/.gitignore b/.gitignore index 4f2cc4b7..b19d550c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.jl.mem Manifest.toml docs/build/ +*.rej