Skip to content

Commit 5402c7f

Browse files
steveklabnikmx-shift
authored andcommitted
Change license check to use a better action
I had implemented this myself previously, because I didn't think this project could do anything more than Apache, but I was wrong. This is much cleaner.
1 parent 99408ec commit 5402c7f

5 files changed

Lines changed: 21 additions & 132 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: license-check
2+
on: pull_request
3+
jobs:
4+
license:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@master
8+
- name: Check License Header
9+
uses: apache/skywalking-eyes@main

.github/workflows/license.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.licenserc.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
header:
2+
license:
3+
spdx-id: MPL-2.0
4+
5+
content: |
6+
This Source Code Form is subject to the terms of the Mozilla Public
7+
License, v. 2.0. If a copy of the MPL was not distributed with this
8+
file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
paths:
10+
- '**/*.rs'
11+
12+
comment: on-failure

build/xtask/src/license.rs

Lines changed: 0 additions & 85 deletions
This file was deleted.

build/xtask/src/main.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ mod elf;
1717
mod flash;
1818
mod gdb;
1919
mod humility;
20-
mod license;
2120
mod task_slot;
2221
mod test;
2322

@@ -123,9 +122,6 @@ enum Xtask {
123122
/// Path to task executable
124123
task_bin: PathBuf,
125124
},
126-
127-
/// Check that all .rs files have the MPL header
128-
LicenseCheck,
129125
}
130126

131127
#[derive(Clone, Debug, Deserialize)]
@@ -416,11 +412,6 @@ fn main() -> Result<()> {
416412
Xtask::TaskSlots { task_bin } => {
417413
task_slot::dump_task_slot_table(&task_bin)?;
418414
}
419-
Xtask::LicenseCheck => {
420-
if !license::check()? {
421-
std::process::exit(1);
422-
}
423-
}
424415
}
425416

426417
Ok(())

0 commit comments

Comments
 (0)