Skip to content

Commit

Permalink
[github-actions] Add a github action to insert apache 2.0 comments (#585
Browse files Browse the repository at this point in the history
)

* [github-actions] Add a github action to insert apache 2.0 comments to each new file

* Automatic application of license header

---------

Co-authored-by: License Bot <[email protected]>
  • Loading branch information
hodanoori and License Bot authored Apr 19, 2024
1 parent 7a3535c commit 1b305bc
Show file tree
Hide file tree
Showing 1,054 changed files with 5,304 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
header:
license:
spdx-id: Apache-2.0
content: |
SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
SPDX-License-Identifier: Apache-2.0
paths: # `paths` are the path list that will be checked (and fixed) by license-eye, default is ['**'].
- "**"

paths-ignore:
- ".github/**"
- "apis/**"
- "assets/**"
- ".npmignore"
- ".npmrc"
- "CODEOWNERS"
- "bin/**"
- "ci/**"
- "config/**"
- "docker/**"
- "docs/**"
- "e2e/**"
- "**/*.md"
- "LICENSE"
- "**/LICENSE"
- "**/*.gitignore"
- "**/*.dockerignore"
- "**/*.helmignore"
- "**/*.tpl"
- "**/go.mod"
- "**/go.sum"
- "**/*.lock"
- "**/*.json"
- "**/.gitkeep"
- "**/*.txt"
- "*Dockerfile*"
- "Makefile"
- "**/*.map"

comment: on-failure

# license-location-threshold specifies the index threshold where the license header can be located,
# after all, a "header" cannot be TOO far from the file start.
license-location-threshold: 80

language:
JSX:
extensions:
- ".jsx"
comment_style_id: SlashAsterisk
35 changes: 35 additions & 0 deletions .github/workflows/license.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check & Fix License Header

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build-license-eye:
name: Build LicenseEye
runs-on: [ubuntu-latest]
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Check License Header
uses: apache/skywalking-eyes/[email protected]
with:
config: .github/licenserc.yaml
mode: fix

- name: Apply Changes
uses: EndBug/add-and-commit@v9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
author_name: License Bot
author_email: [email protected]
message: "Automatic application of license header"
5 changes: 5 additions & 0 deletions apps/assets-overview/__mocks__/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { JSDOM } from "jsdom"
const dom = new JSDOM()
global.document = dom.window.document
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = "test-file-stub"
5 changes: 5 additions & 0 deletions apps/assets-overview/__mocks__/react-markdown.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

function ReactMarkdown({ children }) {
return <>{children}</>
}
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/__mocks__/remark-gfm.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

function remarkGfm({ children }) {
return <>{children}</>
}
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {}
5 changes: 5 additions & 0 deletions apps/assets-overview/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
env: {
test: {
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/esbuild.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

const esbuild = require("esbuild")
const fs = require("node:fs/promises")
const pkg = require("./package.json")
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
transform: { "\\.[jt]sx?$": "babel-jest" },
testEnvironment: "jsdom",
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/public/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
~ SPDX-License-Identifier: Apache-2.0
-->

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/App.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect, useLayoutEffect } from "react"

import useStore from "./store"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { render, act, waitFor } from "@testing-library/react"
// support shadow dom queries
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/actions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

const ENDPOINT = "https://endpoint-url-here.com"

class HTTPError extends Error {
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/AppContent.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useState, useEffect, useMemo } from "react"
import { AppShell, TabPanel, MainTabs, TabList, Tab } from "juno-ui-components"
import useStore from "../store"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/AppRouter.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { Router, Route } from "url-state-router"
import useStore from "../store"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/AssetDetails.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useState, useEffect, useMemo } from "react"
import {
Button,
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/AssetsList.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import {
DataGrid,
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/AssetsListItem.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { DataGridRow, DataGridCell, Pill, Stack } from "juno-ui-components"
import useStore from "../store"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/BuildLog.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import {
DataGrid,
DataGridRow,
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/CustomPageHeader.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { PageHeader, Stack, Icon } from "juno-ui-components"

Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/Documentation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useState, useMemo, useEffect } from "react"
import {
Container,
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/HintLoading.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { Stack, Spinner } from "juno-ui-components"

Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/HintNotFound.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { Stack } from "juno-ui-components"

Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/Markdown.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect } from "react"
import { Stack, Spinner } from "juno-ui-components"
import { useQuery } from "@tanstack/react-query"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/TabContainer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { Container } from "juno-ui-components"
import { Messages } from "messages-provider"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/TestContent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useMemo, useRef, useEffect, useState } from "react"
import { currentState } from "url-state-provider"
import useStore from "../store"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/details/DetailSection.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { sectionCss, headerCss, h1Css } from "../../styles"
import React from "react"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect, useMemo, useState } from "react"
import {
Form,
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/details/TabAdvanced.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { CodeBlock, Container } from "juno-ui-components"

Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/details/TabGetStarted.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import {
DataGrid,
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/components/details/TabPreview.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect, useMemo, useState, useRef } from "react"
import { useAppLoader } from "utils"
import { Box, Stack, Spinner, Message, Icon } from "juno-ui-components"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { Container } from "juno-ui-components"
import Markdown from "../Markdown"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

export const APP = "app"
export const LIB = "lib"

Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/hooks/useAssetTestUrl.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { useInsertionEffect } from "react"
import { stateToQueryParam } from "url-state-provider"
import useStore from "../store"
Expand Down
5 changes: 5 additions & 0 deletions apps/assets-overview/src/img/app_bg_example.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1b305bc

Please sign in to comment.