Skip to content

Commit 55103bf

Browse files
authored
Initial commit
0 parents  commit 55103bf

12 files changed

+471
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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: Look for changes to sonar-project.properties
65+
if: contains(steps.files.outputs.all_files_changed, '"sonar-project.properties"')
66+
uses: mshick/add-pr-comment@v1
67+
with:
68+
message: |
69+
:no_entry: **Banned Files Modified**
70+
Changes to `sonar-project.properties` 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).
71+
repo-token: ${{ secrets.GITHUB_TOKEN }}
72+
- name: Comment if sonar-project.properties changed
73+
if: contains(steps.files.outputs.all_files_changed, '"sonar-project.properties"')
74+
run: |
75+
echo 'Changes to sonar-project.properties are not allowed.'
76+
- name: Fail on banned file changes
77+
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"') || contains(steps.files.outputs.all_files_changed, '"sonar-project.properties"')
78+
run: |
79+
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
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Release ZIP file packaging
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
create_zip:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 'Checkout repo'
12+
uses: actions/checkout@v2
13+
- name: 'Make (and upload) ZIP file(s)'
14+
uses: oracle-devrel/[email protected]
15+
id: zip_maker
16+
with:
17+
github_token: ${{ secrets.GITHUB_TOKEN }}
18+

.github/workflows/repolinter.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Repolinter
2+
on:
3+
pull_request_target:
4+
jobs:
5+
run_repolinter:
6+
name: Run Repolinter on pull request
7+
runs-on: ubuntu-latest
8+
container:
9+
image: ghcr.io/oracledevrel/repolinter:v0.11.1
10+
credentials:
11+
username: ${{ github.actor }}
12+
password: ${{ secrets.GHCR_PAT }}
13+
steps:
14+
- name: 'Checkout repo'
15+
uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.event.pull_request.head.ref }}
18+
repository: ${{ github.event.pull_request.head.repo.full_name }}
19+
- name: Run Repolinter
20+
run: |
21+
set +e
22+
bundle exec /app/bin/repolinter.js lint --format json --rulesetFile repolinter.json . > repolinter_results.json
23+
echo "\n\nHere is the repolinter_results.json:\n"
24+
echo $(cat repolinter_results.json)
25+
exit 0
26+
- name: Analyze the Repolinter results
27+
uses: oracle-devrel/[email protected]
28+
id: analysis
29+
with:
30+
json_results_file: '/github/workspace/repolinter_results.json'
31+
- name: Overall analysis results
32+
run: |
33+
echo "Passed: ${{ steps.analysis.outputs.passed }}"
34+
echo "Errored: ${{ steps.analysis.outputs.errored }}"
35+
- name: Comment if analysis finds missing disclaimer
36+
if: steps.analysis.outputs.disclaimer_found == 'false'
37+
uses: mshick/add-pr-comment@v1
38+
with:
39+
message: |
40+
:no_entry: **FAILURE: Missing Disclaimer**
41+
The standard Oracle Disclaimer seems to be missing from the readme. Please add it:
42+
43+
ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.
44+
45+
Details:
46+
${{ steps.analysis.outputs.disclaimer_details }}
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}
48+
- name: Comment if analysis finds missing readme
49+
if: steps.analysis.outputs.readme_file_found == 'false'
50+
uses: mshick/add-pr-comment@v1
51+
with:
52+
message: |
53+
:no_entry: **FAILURE: Missing README**
54+
The README file seems to be missing. Please add it.
55+
56+
Details:
57+
${{ steps.analysis.outputs.readme_file_details }}
58+
repo-token: ${{ secrets.GITHUB_TOKEN }}
59+
- name: Comment if analysis finds missing license
60+
if: steps.analysis.outputs.license_file_found == 'false'
61+
uses: mshick/add-pr-comment@v1
62+
with:
63+
message: |
64+
:no_entry: **FAILURE: Missing LICENSE**
65+
The LICENSE file seems to be missing. Please add it.
66+
67+
Details:
68+
${{ steps.analysis.outputs.license_file_details }}
69+
repo-token: ${{ secrets.GITHUB_TOKEN }}
70+
- name: Comment if analysis finds copyright notice missing
71+
if: steps.analysis.outputs.copyright_found == 'false'
72+
uses: mshick/add-pr-comment@v1
73+
with:
74+
message: |
75+
:warning: **WARNING: Missing Copyright Notice(s)**
76+
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).
77+
78+
Details:
79+
${{ steps.analysis.outputs.copyright_details }}
80+
repo-token: ${{ secrets.GITHUB_TOKEN }}
81+
- name: Halt pipeline if README is missing
82+
if: steps.analysis.outputs.readme_file_found == 'false'
83+
run: exit 1
84+
- name: Halt pipeline if LICENSE is missing
85+
if: steps.analysis.outputs.license_file_found == 'false'
86+
run: exit 1
87+
- name: Halt pipeline if disclaimer is missing
88+
if: steps.analysis.outputs.disclaimer_found == 'false'
89+
run: exit 1

.github/workflows/sonarcloud.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: SonarCloud Scan
2+
on:
3+
pull_request_target:
4+
jobs:
5+
sonarcloud:
6+
name: SonarCloud
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repo
10+
uses: actions/checkout@v2
11+
with:
12+
ref: ${{ github.event.pull_request.head.ref }}
13+
repository: ${{ github.event.pull_request.head.repo.full_name }}
14+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
15+
- name: SonarCloud Scan
16+
uses: SonarSource/sonarcloud-github-action@master
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
19+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.gitignore

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

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.

0 commit comments

Comments
 (0)