mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Noticed due to https://github.com/carbon-language/carbon-lang/actions/runs/8207272518 ``` Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/. ``` I'm expecting we can just update the version number on these.
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
name: pre-commit
|
|
|
|
on:
|
|
pull_request:
|
|
merge_group:
|
|
push:
|
|
branches: [trunk]
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- 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()
|
|
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()
|
|
with:
|
|
name: pre-commit output
|
|
path: pre-commit-output/*
|