Skip to content

Bump actions/cache from 3 to 4 (#485) #131

Bump actions/cache from 3 to 4 (#485)

Bump actions/cache from 3 to 4 (#485) #131

Workflow file for this run

name: Code Formatting
on:
push:
branches:
- master
# workflow_dispatch: # intentionally disabled
jobs:
format_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the JuliaFormatter package
run: julia --color=yes -e 'using Pkg; Pkg.add(name = "JuliaFormatter", uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899")'
- name: Precompile dependencies
run: julia --color=yes -e 'using Pkg; Pkg.precompile()'
- name: Use JuliaFormatter to format the code with the BlueStyle style
run: julia --color=yes -e 'using JuliaFormatter; format(".", BlueStyle(); verbose = true)'
- name: Create pull request
id: create_pr
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '🤖 Automatically format the source code files'
title: '🤖 Automatically format the source code files'
body: 'This pull request formats the source code files using the JuliaFormatter package.'
# branch: bot/format_pr/${{ github.ref }} # broken, for some reason
branch: bot/format_pr/master # okay to hardcode master, since we disabled workflow_dispatch
delete-branch: true
- run: echo "The pull request number is ${{ steps.create_pr.outputs.pull-request-number }}"
- run: echo "The pull request URL is ${{ steps.create_pr.outputs.pull-request-url }}"