Skip to content

Commit

Permalink
Try new fix for format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lxmota committed Feb 26, 2025
1 parent 91262d2 commit 6544125
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensures full commit history for branch creation

- name: Set up Julia
uses: julia-actions/setup-julia@v1
with:
version: '1.11' # Adjust as needed
version: '1.11'

- name: Install JuliaFormatter
run: julia -e 'using Pkg; Pkg.add("JuliaFormatter"); Pkg.update()'
Expand All @@ -40,12 +42,20 @@ jobs:
BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "Detected branch: $BRANCH_NAME"
git switch "$BRANCH_NAME" 2>/dev/null || git checkout -B "$BRANCH_NAME"
git switch -c format/${BRANCH_NAME}
git commit -m "Auto-format code using JuliaFormatter (spaces only)"
git push origin "$BRANCH_NAME"
fi
git push https://x-access-token:${GH_PAT}@github.com/sandialabs/Norma.jl.git HEAD:format/${BRANCH_NAME}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GH_PAT: ${{ secrets.GH_PAT }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_PAT }}
branch: format/${BRANCH_NAME}
title: "Auto-format code using JuliaFormatter"
body: "This PR applies auto-formatting to the codebase."
base: main

test:
name: Run Tests
Expand Down

0 comments on commit 6544125

Please sign in to comment.