Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusable license workflow #10

Merged
merged 8 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

# Configuration for welcome - https://github.com/behaviorbot/welcome

# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
Expand Down
4 changes: 4 additions & 0 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

---
#########################
#########################
Expand Down
4 changes: 4 additions & 0 deletions .github/linters/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

---
##########################
## Hadolint config file ##
Expand Down
6 changes: 3 additions & 3 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the GNU GPL v3
# license that can be found in the LICENSE file.
#
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

---
###########################
###########################
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/reusable-license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

name: License

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
types: [ opened, synchronize, reopened ]
workflow_call:

permissions:
contents: read

jobs:
header:
runs-on: ubuntu-latest
name: Check License Headers
steps:
- name: Harden Runner
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34 # v1.5.0
with:
egress-policy: block
disable-telemetry: true
allowed-endpoints: >
github.com:443
api.github.com:443

- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
persist-credentials: false

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- name: Check License Header
uses: apache/skywalking-eyes/header@438e4ea5682269933ea2c8b5608662e52af26959 # v0.4.0

dependency:
runs-on: ubuntu-latest
name: "Check Dependencies' License"
steps:
- name: Harden Runner
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34 # v1.5.0
with:
egress-policy: block
disable-telemetry: true
allowed-endpoints: >
github.com:443
api.github.com:443

- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
persist-credentials: false

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- name: "Check Dependencies' License"
uses: apache/skywalking-eyes/dependency@438e4ea5682269933ea2c8b5608662e52af26959 # v0.4.0

4 changes: 4 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

name: ReviewDog

on:
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/stale.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

header:
license:
spdx-id: MIT
copyright-owner: Wayback Archiver
content: |
Copyright 2020 Wayback Archiver. All rights reserved.
Use of this source code is governed by the MIT license
that can be found in the LICENSE file.

paths-ignore:
- '.github/ISSUE_TEMPLATE'
- '.github/PULL_REQUEST_TEMPLATE'
- '.gitattributes'
- '.semgrepignore'
- '**/*.md'
- 'LICENSE'
- 'CODEOWNERS'

comment: on-failure