Skip to content

Commit d40572a

Browse files
committed
Initial template
0 parents  commit d40572a

10 files changed

+406
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Banned file changes (PR)
2+
on:
3+
# pull_request:
4+
# branches: [ "**/*" ]
5+
pull_request_target:
6+
7+
jobs:
8+
check_for_banned_file_changes:
9+
name: Look for unsupported (banned) file modifications on PRs
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Get number of git commits'
13+
uses: oracle-devrel/[email protected]
14+
id: num_commits
15+
with:
16+
pull_url: ${{ github.event.pull_request.url }}
17+
- name: 'Checkout repo'
18+
uses: actions/checkout@v2
19+
with:
20+
ref: ${{ github.event.pull_request.head.ref }}
21+
repository: ${{ github.event.pull_request.head.repo.full_name }}
22+
fetch-depth: ${{ steps.num_commits.outputs.fetch_depth }}
23+
- name: Get file changes
24+
uses: oracle-devrel/[email protected]
25+
id: files
26+
with:
27+
pull_url: ${{ github.event.pull_request.url }}
28+
- name: Look for changes to .github
29+
if: contains(steps.files.outputs.all_files_changed, '.github')
30+
run: |
31+
echo 'Changes to files in .github are not allowed.'
32+
- name: Comment if .github changed
33+
if: contains(steps.files.outputs.all_files_changed, '.github')
34+
uses: mshick/add-pr-comment@v1
35+
with:
36+
message: |
37+
:no_entry: **Banned Files Modified**
38+
Changes to files in `.github` are not permitted. Please revert your changes and re-submit a new PR. Simply changing the file back to its original state and re-committing won't work (you must revert the changes made to it).
39+
repo-token: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Look for changes to license_policy.yml
41+
if: contains(steps.files.outputs.all_files_changed, '"license_policy.yml"')
42+
run: |
43+
echo 'Changes to license_policy.yml are not allowed.'
44+
- name: Comment if license_policy.yml changed
45+
if: contains(steps.files.outputs.all_files_changed, '"license_policy.yml"')
46+
uses: mshick/add-pr-comment@v1
47+
with:
48+
message: |
49+
:no_entry: **Banned Files Modified**
50+
Changes to `license_policy.yml` are not permitted. Please revert your changes and re-submit a new PR. Simply changing the file back to its original state and re-committing won't work (you must revert the changes made to it).
51+
repo-token: ${{ secrets.GITHUB_TOKEN }}
52+
- name: Look for changes to repolinter.json
53+
if: contains(steps.files.outputs.all_files_changed, '"repolinter.json"')
54+
uses: mshick/add-pr-comment@v1
55+
with:
56+
message: |
57+
:no_entry: **Banned Files Modified**
58+
Changes to `repolinter.json` are not permitted. Please revert your changes and re-submit a new PR. Simply changing the file back to its original state and re-committing won't work (you must revert the changes made to it).
59+
repo-token: ${{ secrets.GITHUB_TOKEN }}
60+
- name: Comment if repolinter.json changed
61+
if: contains(steps.files.outputs.all_files_changed, '"repolinter.json"')
62+
run: |
63+
echo 'Changes to repolinter.json are not allowed.'
64+
- name: Fail on banned file changes
65+
if: contains(steps.files.outputs.all_files_changed, '.github') || contains(steps.files.outputs.all_files_changed, '"license_policy.yml"') || contains(steps.files.outputs.all_files_changed, '"repolinter.json"')
66+
run: |
67+
exit 1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Banned file changes (push)
2+
on:
3+
push:
4+
branches: [ "**/*" ]
5+
6+
jobs:
7+
check_for_banned_file_changes:
8+
if: contains('snafuz timclegg', github.actor) == false
9+
name: Prohibit any pushes
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Post comment
13+
uses: mshick/add-pr-comment@v1
14+
with:
15+
message: |
16+
:no_entry: **Push Not Supported**
17+
Please utilize pull requests for all repo changes (not pushing directly to the repo).
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Fail
20+
run: |
21+
exit 1

.github/workflows/cla.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened,closed,synchronize]
7+
8+
jobs:
9+
CLAssistant:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "CLA Assistant"
13+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
14+
# Beta Release
15+
uses: cla-assistant/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
# the below token should have repo scope and must be manually added by you in the repository's secret
19+
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20+
with:
21+
# for per-repo CLA-acceptance:
22+
# path-to-signatures: 'signatures/oca-20210504/${{ github.repository }}'
23+
# for per-GHO CLA-acceptance:
24+
path-to-signatures: 'signatures/oca-20210504/oracledevrel'
25+
path-to-document: 'https://github.com/oracledevrel/devrel-oca-mgmt/blob/main/oca-20210504.md' # e.g. a CLA or a DCO document
26+
# branch should not be protected
27+
branch: 'main'
28+
allowlist: bot*
29+
30+
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
31+
remote-organization-name: "oracledevrel" # enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
32+
remote-repository-name: "devrel-oca-mgmt" # enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
33+
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
34+
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
35+
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
36+
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
37+
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
38+
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
39+
#use-dco-flag: true - If you are using DCO instead of CLA

.github/workflows/license_audit.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Audit licenses
2+
on:
3+
pull_request_target:
4+
5+
jobs:
6+
run_scancode_toolkit:
7+
name: Get inventory of licenses used in project
8+
runs-on: ubuntu-latest
9+
container:
10+
image: ghcr.io/oracledevrel/scancode-toolkit:v21.3.31
11+
credentials:
12+
username: ${{ github.actor }}
13+
password: ${{ secrets.GHCR_PAT }}
14+
steps:
15+
- name: 'Checkout repo'
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
repository: ${{ github.event.pull_request.head.repo.full_name }}
20+
- name: Run Scancode-toolkit
21+
run: |
22+
scancode -l --ignore licenses.json --ignore .github/**/* --ignore license_policy.yml --license-policy license_policy.yml --only-findings --summary --json-pp licenses.json *
23+
echo "\n\nHere is the licenses.json:\n"
24+
echo $(cat licenses.json)
25+
- name: Look for non-approved licenses
26+
uses: oracle-devrel/[email protected]
27+
id: analysis
28+
with:
29+
licenses_file: '/github/workspace/licenses.json'
30+
- name: Analysis results
31+
run: echo "${{ steps.analysis.outputs.unapproved_licenses }}"
32+
- name: Comment if analysis finds unapproved licenses
33+
if: steps.analysis.outputs.unapproved_licenses == 'true'
34+
uses: mshick/add-pr-comment@v1
35+
with:
36+
message: |
37+
:no_entry: **License Inspection**
38+
Requires manual inspection. There are some licenses which dictate further analysis and review.
39+
repo-token: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Halt pipeline on unapproved licenses
41+
if: steps.analysis.outputs.unapproved_licenses == 'true'
42+
run: exit 1

.github/workflows/repolinter.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Repolinter
2+
on:
3+
pull_request_target:
4+
5+
jobs:
6+
run_repolinter:
7+
name: Run Repolinter on pull request
8+
runs-on: ubuntu-latest
9+
container:
10+
image: ghcr.io/oracledevrel/repolinter:v0.11.1
11+
credentials:
12+
username: ${{ github.actor }}
13+
password: ${{ secrets.GHCR_PAT }}
14+
steps:
15+
- name: 'Checkout repo'
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
repository: ${{ github.event.pull_request.head.repo.full_name }}
20+
- name: Run Repolinter
21+
run: |
22+
set +e
23+
bundle exec /app/bin/repolinter.js lint --format json --rulesetFile repolinter.json . > repolinter_results.json
24+
echo "\n\nHere is the repolinter_results.json:\n"
25+
echo $(cat repolinter_results.json)
26+
exit 0
27+
- name: Analyze the Repolinter results
28+
uses: oracle-devrel/[email protected]
29+
id: analysis
30+
with:
31+
json_results_file: '/github/workspace/repolinter_results.json'
32+
- name: Overall analysis results
33+
run: |
34+
echo "Passed: ${{ steps.analysis.outputs.passed }}"
35+
echo "Errored: ${{ steps.analysis.outputs.errored }}"
36+
- name: Comment if analysis finds missing readme
37+
if: steps.analysis.outputs.readme_file_found == 'false'
38+
uses: mshick/add-pr-comment@v1
39+
with:
40+
message: |
41+
:no_entry: **FAILURE: Missing README**
42+
The README file seems to be missing. Please add it.
43+
44+
Details:
45+
${{ steps.analysis.outputs.readme_file_details }}
46+
repo-token: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Comment if analysis finds missing license
48+
if: steps.analysis.outputs.license_file_found == 'false'
49+
uses: mshick/add-pr-comment@v1
50+
with:
51+
message: |
52+
:no_entry: **FAILURE: Missing LICENSE**
53+
The LICENSE file seems to be missing. Please add it.
54+
55+
Details:
56+
${{ steps.analysis.outputs.license_file_details }}
57+
repo-token: ${{ secrets.GITHUB_TOKEN }}
58+
- name: Comment if analysis finds blacklisted words
59+
if: steps.analysis.outputs.blacklisted_words_found == 'true'
60+
uses: mshick/add-pr-comment@v1
61+
with:
62+
message: |
63+
:no_entry: **FAILURE: Blacklisted Words Found**
64+
There are some words that we forbid usage of. It looks like at least one of these was found. Please remove.
65+
66+
Details:
67+
${{ steps.analysis.outputs.blacklisted_words_details }}
68+
repo-token: ${{ secrets.GITHUB_TOKEN }}
69+
- name: Comment if analysis finds copyright notice missing
70+
if: steps.analysis.outputs.copyright_found == 'false'
71+
uses: mshick/add-pr-comment@v1
72+
with:
73+
message: |
74+
:warning: **WARNING: Missing Copyright Notice(s)**
75+
It's a good idea to have copyright notices at the top of each file. It looks like at least one file was missing this (though it might be further down in the file - this might be a false-positive).
76+
77+
Details:
78+
${{ steps.analysis.outputs.copyright_details }}
79+
repo-token: ${{ secrets.GITHUB_TOKEN }}
80+
- name: Halt pipeline if README is missing
81+
if: steps.analysis.outputs.readme_file_found == 'false'
82+
run: exit 1
83+
- name: Halt pipeline if LICENSE is missing
84+
if: steps.analysis.outputs.license_file_found == 'false'
85+
run: exit 1
86+
- name: Halt pipeline if blacklisted word(s) found
87+
if: steps.analysis.outputs.blacklisted_words_found == 'true'
88+
run: exit 1

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# General
2+
.DS_Store
3+
.AppleDouble
4+
.LSOverride
5+
6+
# Icon must end with two \r
7+
Icon
8+
9+
# Thumbnails
10+
._*
11+
12+
# Files that might appear in the root of a volume
13+
.DocumentRevisions-V100
14+
.fseventsd
15+
.Spotlight-V100
16+
.TemporaryItems
17+
.Trashes
18+
.VolumeIcon.icns
19+
.com.apple.timemachine.donotpresent
20+
21+
# Directories potentially created on remote AFP share
22+
.AppleDB
23+
.AppleDesktop
24+
Network Trash Folder
25+
Temporary Items
26+
.apdisk

LICENSE

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2021 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# TITLE
2+
3+
## Introduction
4+
MISSING
5+
6+
## Getting Started
7+
MISSING
8+
9+
### Prerequisites
10+
MISSING
11+
12+
## Notes/Issues
13+
MISSING
14+
15+
## URLs
16+
* Nothing at this time
17+
18+
## Contributing
19+
This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community.
20+
21+
## License
22+
Copyright (c) 2021 Oracle and/or its affiliates.
23+
24+
Licensed under the Universal Permissive License 1.0.
25+
26+
See [LICENSE](LICENSE) for more details.

license_policy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
license_policies:
2+
- license_key: upl-1.0
3+
label: Approved License
4+
color_code: '#00800'
5+
icon: icon-ok-circle

0 commit comments

Comments
 (0)