Skip to content

Commit fa002f0

Browse files
authored
Fix CI for copyright header (#16)
1 parent e043f0d commit fa002f0

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.github/workflows/ci.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
1+
# Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -35,7 +35,20 @@ jobs:
3535
- name: Install pre-commit
3636
run: pip install pre-commit
3737
- name: Pre-commit checks
38-
# CI will commit to `main`
38+
# CI will commit to `main`, insert-license tested separately
3939
run: >
40-
SKIP=no-commit-to-branch
40+
SKIP=no-commit-to-branch,insert-license
4141
pre-commit run --all-files
42+
insert-license:
43+
timeout-minutes: 1
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 2
49+
- name: Install pre-commit
50+
run: pip install pre-commit
51+
- name: List changed files
52+
run: git diff --name-only HEAD~1
53+
- name: Run license check
54+
run: pre-commit run insert-license --files $(git diff --name-only HEAD~1)

.pre-commit-config.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
1+
# Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414

1515
repos:
1616
- repo: https://github.com/pre-commit/pre-commit-hooks
17-
rev: v4.6.0
17+
rev: v5.0.0
1818
hooks:
1919
- id: fix-byte-order-marker
2020
- id: check-case-conflict
@@ -28,7 +28,7 @@ repos:
2828
- id: no-commit-to-branch
2929
args: [--branch, main]
3030
- repo: https://github.com/crate-ci/typos
31-
rev: v1.22.9
31+
rev: v1.29.3
3232
hooks:
3333
- id: typos
3434
- repo: https://github.com/Lucas-C/pre-commit-hooks
@@ -43,15 +43,17 @@ repos:
4343
- --comment-style
4444
- //
4545
- --allow-past-years
46+
- --use-current-year
4647
- id: insert-license
4748
name: insert-license-yaml
4849
'types_or': [yaml]
4950
args:
5051
- --license-filepath
5152
- copyright-header.txt
5253
- --allow-past-years
54+
- --use-current-year
5355
- repo: https://github.com/bufbuild/buf
54-
rev: v1.36.0
56+
rev: v1.48.0
5557
hooks:
5658
- id: buf-lint
5759
- id: buf-format

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Thanks for your interest in contributing.
66
We would love contributions in the form of feedback via [GitHub Issues](https://github.com/apple/swift-homomorphic-encryption-protobuf/issues), pull requests with new features, bug fixes, documentation (including fixing typos!), and your ideas.
77
If it's a big change, please start with an Issue.
88

9-
Before contributing, please run [`pre-commit`](https://pre-commit.com), e.g. via `pre-commit run --all-files`. This will perform some basic formatting checks.
10-
11-
To install `pre-commit`, follow instructions in https://pre-commit.com/. We recommend `brew install pre-commit`.
9+
Before contributing, please install [`pre-commit`](https://pre-commit.com), e.g. via `brew install pre-commit`.
10+
Then run `pre-commit install` to install pre-commit for the repository.
11+
Then on each commit, some basic formatting checks will be run.
1212

1313
### Pull Requests:
1414
Before making a commit for a pull request, please run `pre-commit install`.

0 commit comments

Comments
 (0)