Skip to content

feat: Add stub Explorer endpoints for self-hosted compatibility #40

feat: Add stub Explorer endpoints for self-hosted compatibility

feat: Add stub Explorer endpoints for self-hosted compatibility #40

Workflow file for this run

name: Linting
on:
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
statuses: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get changed files
id: changes
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
with:
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
list-files: json
filters: |
all:
- added|modified: '**/*'
- uses: getsentry/action-setup-venv@3a832a9604b3e1a4202ae559248f26867b467cc7 # v2.1.1
with:
python-version: 3.11.8
cache-dependency-path: |
requirements.txt
install-cmd: pip install -r requirements-precommit.txt
- name: Setup pre-commit
run: |
pre-commit install
- name: Run pre-commit on PR commits
id: pre-commit_results
continue-on-error: true
run: |
jq '.[]' --raw-output <<< '${{steps.changes.outputs.all_files}}' |
# Run pre-commit to check files that were changed (but not deleted) compared to master.
# --show-diff-on-failure will display what needs to be fixed without making changes
xargs pre-commit run --show-diff-on-failure --files
# Auto-fix requires Sentry's internal GitHub App - skip for forks
- name: Get auth token
id: token
if: ${{ steps.pre-commit_results.outcome == 'failure' && vars.SENTRY_INTERNAL_APP_ID != '' }}
continue-on-error: true
uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3.0.0
with:
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
- name: Apply any pre-commit fixed files
if: ${{ steps.pre-commit_results.outcome == 'failure' && steps.token.outputs.token != '' }}
uses: getsentry/action-github-commit@5972d5f578ad77306063449e718c0c2a6fbc4ae1 # v2.1.0
with:
github-token: ${{ steps.token.outputs.token }}
message: ":hammer_and_wrench: apply pre-commit fixes"
- name: Fail job if pre-commit failed
if: ${{ steps.pre-commit_results.outcome == 'failure' }}
run: |
echo "Pre-commit checks failed. Please fix the issues and try again."
exit 1