mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 13:11:05 +01:00
Unify pre-commit actions and attempt to fix suggestion-bot (#3750)
This commit is contained in:
@@ -6,6 +6,9 @@ name: pre-commit
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
merge_group:
|
||||
push:
|
||||
branches: [trunk]
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
@@ -14,14 +17,21 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: pre-commit/action@v3.0.0
|
||||
|
||||
# We want to automatically create github suggestions for pre-commit file
|
||||
# changes for a pull request. But `pull_request` actions never have write
|
||||
# permissions to the repository, so we create the suggestions in a separate
|
||||
# privileged `workflow_run` action in pre_commit_suggestions.yaml. Here,
|
||||
# we upload the diffs and event configuration to an artifact for use by
|
||||
# that action.
|
||||
- name: Collect pre-commit output
|
||||
if: ${{ failure() }}
|
||||
if: failure()
|
||||
run: |
|
||||
mkdir -p pre-commit-output
|
||||
git diff > pre-commit-output/diff
|
||||
cp $GITHUB_EVENT_PATH pre-commit-output/event
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ failure() }}
|
||||
if: failure()
|
||||
with:
|
||||
name: pre-commit output
|
||||
path: pre-commit-output/*
|
||||
|
||||
Reference in New Issue
Block a user