Skip to content

Commit

Permalink
Define "format-pr" workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Nov 1, 2023
1 parent 4c89142 commit a4cfb86
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/format-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: format-pr
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- master
- develop

steps:
- uses: julia-actions/setup-julia@v1
with:
version: '1.9'

- uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}

- name: Install JuliaFormatter.jl
shell: julia --color=yes {0}
run: |
import Pkg
Pkg.add("JuliaFormatter")
- name: Format code
shell: julia --color=yes {0}
run: |
using JuliaFormatter
format(".")
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Format .jl files
title: 'Format code'
branch: auto-juliaformatter-pr
delete-branch: true
labels: format

- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

0 comments on commit a4cfb86

Please sign in to comment.