Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ permissions:
jobs:
fmt:
runs-on: ubuntu-latest
# Explicit job-level permissions
permissions:
contents: write
pull-requests: write
issues: write

steps:
- name: Resolve PR head
id: pr
run: |
echo "repo=${{ github.event.client_payload.pull_request.head.repo.full_name }}" >> "$GITHUB_OUTPUT"
echo "ref=${{ github.event.client_payload.pull_request.head.ref }}" >> "$GITHUB_OUTPUT"
echo "number=${{ github.event.client_payload.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "is_fork=${{ github.event.client_payload.pull_request.head.repo.fork }}" >> "$GITHUB_OUTPUT"

# Use a repo-scoped PAT for forks, else fall back to GITHUB_TOKEN
- name: Set push token
Expand Down Expand Up @@ -56,10 +63,44 @@ jobs:
git push origin "HEAD:${{ steps.pr.outputs.ref }}"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "No formatting changes"
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Push changes
if: steps.commit.outputs.changed == 'true' && steps.pr.outputs.is_fork == 'false'
run: git push origin "HEAD:${{ steps.pr.outputs.ref }}"

- name: Trigger Linux build/test
if: steps.fmt.outputs.changed == 'true'
run: |
gh workflow run linux_build_test.yml --ref "${{ github.head_ref }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Trigger macOS build/test
if: steps.fmt.outputs.changed == 'true'
run: |
gh workflow run macos_build_test.yml --ref "${{ github.head_ref }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment if forked
if: steps.pr.outputs.is_fork == 'true' && steps.commit.outputs.changed == 'true'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.token.outputs.token }}
issue-number: ${{ steps.pr.outputs.number }}
body: |
⚠️ This PR comes from a fork (`${{ steps.pr.outputs.repo }}`), so the bot can't push changes.
Please run:
```bash
cargo fmt --all
```
locally and commit the results.


- name: Comment on PR
if: steps.commit.outputs.changed == 'false'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.token.outputs.token }}
Expand Down
1 change: 0 additions & 1 deletion aria-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ impl From<&Args> for VmOptions {
options.dump_stack = true;
}
}

options.vm_args = value.extra_args.clone();

options
Expand Down