diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/main.yml | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 39f65c9..8e0ae23 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,6 @@ name: Short-Tests # Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the mydev branch push: branches-ignore: - "gh-readonly-queue**" @@ -86,25 +85,21 @@ jobs: - name: Run Simulation run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh format-code: - runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + runs-on: tgrogers-raid needs: [build-TITANV, build-TITANV-LOCALXBAR, build-QV100, build-2060, build-3070] - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push the - # added or changed files to the repository. - contents: write steps: - uses: actions/checkout@v4 - # Other steps that change files in the repository go here - # … + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + ssh-key: '' + - name: Run clang-format run: | - sudo apt-get install -y clang-format + git config user.name "purdue-jenkins" + git config user.email "[email protected]" + git remote set-url origin [email protected]:${{github.event.pull_request.head.repo.full_name}} + git remote -v /bin/bash ./format-code.sh - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - # Optional. Commit message for the created commit. - # Defaults to "Apply automatic changes" - commit_message: Automated clang-format - # Optional. Option used by `git-status` to determine if the repository is - # dirty. See https://git-scm.com/docs/git-status#_options - status_options: '--untracked-files=no'
\ No newline at end of file + if git status --untracked-files=no | grep -q "nothing to commit"; then echo "No changes to commit."; else git commit -a -m "Automated Format"; git push; fi |
