Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable CI linting for now because it doesn't work atm. #1172

Merged
merged 1 commit into from
Sep 17, 2024
Merged
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
132 changes: 70 additions & 62 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,71 @@
name: Linting
# Our token isn't provisioned with permission to actually commit back CI fixed
# Run getsentry/action-github-commit@v2.1.0
#Error: HttpError: Resource not accessible by integration - https://docs.github.com/rest/git/trees#create-a-tree
# at /home/runner/work/_actions/getsentry/action-github-commit/v2.1.0/dist/index.js:7748:21
# at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
#Error: Resource not accessible by integration - https://docs.github.com/rest/git/trees#create-a-tree
# TODO: Address this later.

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: read
contents: write
statuses: write

steps:
- uses: actions/checkout@v3
- 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: '**/*'

# TODO: split out requirements-dev.txt
- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
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 lint and format check files that were changed (but not deleted) compared to master.
xargs pre-commit run --files

- name: Get auth token
id: token
if: ${{ steps.pre-commit_results.outcome == 'failure' }}
uses: getsentry/action-github-app-token@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' }}
# note: this runs "always" or else it's skipped when pre-commit fails
uses: getsentry/action-github-commit@v2.1.0
with:
github-token: ${{ steps.token.outputs.token }}
message: ':hammer_and_wrench: apply pre-commit fixes'
#name: Linting
#
#on:
# pull_request:
#
#concurrency:
# group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
# cancel-in-progress: true
#
#jobs:
# build:
# runs-on: ubuntu-latest
# permissions:
# pull-requests: read
# contents: write
# statuses: write
#
# steps:
# - uses: actions/checkout@v3
# - 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: '**/*'
#
# # TODO: split out requirements-dev.txt
# - uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
# 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 lint and format check files that were changed (but not deleted) compared to master.
# xargs pre-commit run --files
#
# - name: Get auth token
# id: token
# if: ${{ steps.pre-commit_results.outcome == 'failure' }}
# uses: getsentry/action-github-app-token@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' }}
# # note: this runs "always" or else it's skipped when pre-commit fails
# uses: getsentry/action-github-commit@v2.1.0
# with:
# github-token: ${{ steps.token.outputs.token }}
# message: ':hammer_and_wrench: apply pre-commit fixes'
Loading