Browse Source

fix: further action changes.

pull/436/head
Dan Ditomaso 1 year ago
parent
commit
84ca90ae97
  1. 28
      .github/workflows/format.yml

28
.github/workflows/format.yml

@ -1,11 +1,8 @@
name: Code Formatting name: Code Formatting
on: on:
push:
branches: [ main, master ]
pull_request: pull_request:
branches: [ main, master ] branches: [ main, master ]
# Allow manual triggering
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -13,15 +10,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
# Give the default GITHUB_TOKEN write permission to commit and push
contents: write contents: write
pull-requests: write
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 ref: ${{ github.head_ref }}
token: ${{ github.token }} fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
@ -39,18 +37,12 @@ jobs:
run: | run: |
git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT
- name: Configure Git
if: steps.git-check.outputs.changes == 'true'
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Commit and push changes - name: Commit and push changes
if: steps.git-check.outputs.changes == 'true' if: steps.git-check.outputs.changes == 'true'
run: | run: |
branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} git config --global user.email "github-actions[bot]@users.noreply.github.com"
echo "Current branch: $branch_name" git config --global user.name "github-actions[bot]"
git add -A
git status git add -A
git commit -m "chore: format code" git commit -m "chore: format code"
git push origin HEAD:$branch_name git push
Loading…
Cancel
Save