Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/changelog-preview.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Changelog Preview
on:
pull_request:
pull_request_target:
types:
- opened
- synchronize
Expand All @@ -9,7 +9,7 @@ on:
- labeled
- unlabeled
permissions:
contents: write
contents: read
pull-requests: write
statuses: write

Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,18 @@ jobs:
# actions/checkout fetches only a single commit in a detached HEAD state. Therefore
# we need to pass the current branch, otherwise we can't commit the changes.
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
#
# For fork PRs we can't push back to the contributor's branch, so we fail the check
# instead — prompting the contributor to run dotnet format locally.
- name: Commit Formatted Code
run: ./scripts/commit-formatted-code.sh $GITHUB_HEAD_REF
run: |
if [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
if [[ $(git status) != *"nothing to commit"* ]]; then
echo "::error::Formatting issues found. Please run the following command locally and push the result:"
echo "::error:: dotnet format Sentry.slnx --no-restore --exclude ./modules ./**/*OptionsSetup.cs ./test/Sentry.Tests/AttributeReaderTests.cs"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

exit 1
fi
echo "All code formatted correctly."
else
./scripts/commit-formatted-code.sh $GITHUB_HEAD_REF
fi
Loading