Skip to content

Commit ab7f7ba

Browse files
committed
Added dependabot, cla bot, codescan, repo lint, badge
1 parent 1a853ed commit ab7f7ba

File tree

4 files changed

+360
-0
lines changed

4 files changed

+360
-0
lines changed

.github/dependabot.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
labels:
8+
- "gh-actions"
9+
- "dependencies"
10+
commit-message:
11+
prefix: "gh-actions"
12+
include: "scope"
13+
14+
# Only for repos with a package.json
15+
# - package-ecosystem: npm
16+
# directory: /
17+
# schedule:
18+
# interval: weekly
19+
# labels:
20+
# - "npm"
21+
# - "dependencies"
22+
# commit-message:
23+
# prefix: "npm"
24+
# include: "scope"
25+
26+
# - package-ecosystem: npm
27+
# directory: /lambda
28+
# schedule:
29+
# interval: weekly
30+
# labels:
31+
# - "npm"
32+
# - "dependencies"
33+
# commit-message:
34+
# prefix: "npm"
35+
# include: "scope"
36+
37+
# other supported packages can be found here: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem

.github/workflows/cla.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened,closed,synchronize]
7+
8+
# select correct state for repository
9+
env:
10+
# state: private
11+
state: public
12+
13+
jobs:
14+
public-or-private-repo:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
repostate: ${{ steps.repo-state.outputs.repostate }}
18+
steps:
19+
20+
- name: Repo state
21+
id: repo-state
22+
run: echo "repostate=${{env.state}}" >> $GITHUB_OUTPUT
23+
- name: Repo public?
24+
if: "${{ env.state == 'public' }}"
25+
run: echo "Workflow has repo set as public. If this is incorrect, uncomment line 10."
26+
- name: Repo private?
27+
if: "${{ env.state == 'private' }}"
28+
run: echo "Workflow has repo set as private. If this is incorrect, uncomment line 11."
29+
30+
CLAssistant:
31+
needs: public-or-private-repo
32+
if: needs.public-or-private-repo.outputs.repostate == 'public'
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: "CLA Assistant"
36+
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'
37+
# Beta Release
38+
uses: contributor-assistant/github-action@v2.2.1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
# the below token should have repo scope and must be manually added by you in the repository's secret
42+
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
43+
with:
44+
path-to-signatures: 'signatures/version1/cla.json'
45+
path-to-document: 'https://github.com/cla-assistant/github-action/blob/master/SAPCLA.md' # e.g. a CLA or a DCO document
46+
# branch should not be protected
47+
branch: 'master'
48+
allowlist: bot*, dependabot[bot], davidsulpy, rkuhlman, adametry, bborntrager, RChloe, TJBIII, JeffLoucks, krcummings1, ijavierTek
49+
50+
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
51+
remote-organization-name: 'initialstate'
52+
remote-repository-name: 'cla-signatures'
53+
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
54+
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
55+
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
56+
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
57+
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
58+
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
59+
#use-dco-flag: true - If you are using DCO instead of CLA

.github/workflows/codeql-analysis.yml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '17 16 * * 4'
22+
23+
# select correct state for repository
24+
env:
25+
# state: private
26+
state: public
27+
28+
jobs:
29+
public-or-private-repo:
30+
runs-on: ubuntu-latest
31+
outputs:
32+
repostate: ${{ steps.repo-state.outputs.repostate }}
33+
steps:
34+
35+
- name: Repo state
36+
id: repo-state
37+
run: echo "repostate=${{env.state}}" >> $GITHUB_OUTPUT
38+
- name: Repo public?
39+
if: "${{ env.state == 'public' }}"
40+
run: echo "Workflow has repo set as public. If this is incorrect, uncomment line 25."
41+
- name: Repo private?
42+
if: "${{ env.state == 'private' }}"
43+
run: echo "Workflow has repo set as private. If this is incorrect, uncomment line 26."
44+
45+
# REMEMBER TO CHECK `LANGUAGE` MATRIX FOR CORRECT LANGUAGE SETTINGS
46+
analyze:
47+
needs: public-or-private-repo
48+
if: needs.public-or-private-repo.outputs.repostate == 'public'
49+
name: Analyze
50+
runs-on: ubuntu-latest
51+
permissions:
52+
actions: read
53+
contents: read
54+
security-events: write
55+
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
language: [ 'python' ]
60+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
61+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
62+
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v3
66+
67+
# Initializes the CodeQL tools for scanning.
68+
- name: Initialize CodeQL
69+
uses: github/codeql-action/init@v2
70+
with:
71+
languages: ${{ matrix.language }}
72+
# If you wish to specify custom queries, you can do so here or in a config file.
73+
# By default, queries listed here will override any specified in a config file.
74+
# Prefix the list here with "+" to use these queries and those in the config file.
75+
76+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
77+
# queries: security-extended,security-and-quality
78+
79+
80+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
81+
# If this step fails, then you should remove it and run the build manually (see below)
82+
- name: Autobuild
83+
uses: github/codeql-action/autobuild@v2
84+
85+
# ℹ️ Command-line programs to run using the OS shell.
86+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87+
88+
# If the Autobuild fails above, remove it and uncomment the following three lines.
89+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
90+
91+
# - run: |
92+
# echo "Run, Build Application using script"
93+
# ./location_of_script_within_repo/buildscript.sh
94+
95+
- name: Perform CodeQL Analysis
96+
uses: github/codeql-action/analyze@v2
97+
with:
98+
category: "/language:${{matrix.language}}"

.github/workflows/is-repo-lint.yml

+166
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: is-repo-lint
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
workflow_dispatch:
8+
9+
# select correct state for repository
10+
env:
11+
# state: private
12+
state: public
13+
14+
jobs:
15+
public-or-private-repo:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
repostate: ${{ steps.repo-state.outputs.repostate }}
19+
steps:
20+
21+
- name: Repo state
22+
id: repo-state
23+
run: echo "repostate=${{env.state}}" >> $GITHUB_OUTPUT
24+
- name: Repo public?
25+
if: "${{ env.state == 'public' }}"
26+
run: echo "Workflow has repo set as public. If this is incorrect, uncomment line 11."
27+
- name: Repo private?
28+
if: "${{ env.state == 'private' }}"
29+
run: echo "Workflow has repo set as private. If this is incorrect, uncomment line 12."
30+
31+
check-for-codeowners-file:
32+
runs-on: ubuntu-latest
33+
steps:
34+
35+
- name: Checkout repo
36+
uses: actions/checkout@v3
37+
38+
- name: Check for CODEOWNERS
39+
id: codeowners_file
40+
uses: initialstate/file-check-action@v1
41+
with:
42+
file: ".github/CODEOWNERS"
43+
44+
- name: CODEOWNERS file Output Test
45+
run: echo ${{ steps.codeowners_file.outputs.file_exists }}
46+
47+
- name: CODEOWNERS file exists with content
48+
if: steps.codeowners_file.outputs.file_exists == 'true'
49+
run: echo CODEOWNERS file exists!
50+
51+
- name: CODEOWNERS file does not exist
52+
if: steps.codeowners_file.outputs.file_exists == 'false'
53+
run: echo CODEOWNERS file does not exist!
54+
55+
check-for-readme-file:
56+
runs-on: ubuntu-latest
57+
steps:
58+
59+
- name: Checkout repo
60+
uses: actions/checkout@v3
61+
62+
- name: Check for README.md
63+
id: readme_file
64+
uses: initialstate/file-check-action@v1
65+
with:
66+
file: "README"
67+
68+
- name: README file Output Test
69+
run: echo ${{ steps.readme_file.outputs.file_exists }}
70+
71+
- name: README file exists with content
72+
if: steps.readme_file.outputs.file_exists == 'true'
73+
run: echo README file exists!
74+
75+
- name: README file does not exist
76+
if: steps.readme_file.outputs.file_exists == 'false'
77+
run: echo README file does not exist!
78+
79+
check-for-license:
80+
needs: public-or-private-repo
81+
if: needs.public-or-private-repo.outputs.repostate == 'public'
82+
runs-on: ubuntu-latest
83+
steps:
84+
85+
- name: Checkout repo
86+
uses: actions/checkout@v3
87+
88+
- name: Check for LICENSE.md
89+
id: license_file
90+
uses: initialstate/file-check-action@v1
91+
with:
92+
file: "LICENSE"
93+
94+
- name: LICENSE file Output Test
95+
run: echo ${{ steps.license_file.outputs.file_exists }}
96+
97+
- name: LICENSE file exists with content
98+
if: steps.license_file.outputs.file_exists == 'true'
99+
run: echo LICENSE file exists!
100+
101+
- name: LICENSE file does not exist
102+
if: steps.license_file.outputs.file_exists == 'false'
103+
run: echo LICENSE file does not exist!
104+
105+
check-for-dependabot-file:
106+
runs-on: ubuntu-latest
107+
steps:
108+
109+
- name: Checkout repo
110+
uses: actions/checkout@v3
111+
112+
- name: Check for dependabot.yml
113+
id: dependabot_file
114+
uses: initialstate/file-check-action@v1
115+
with:
116+
file: ".github/dependabot.yml"
117+
118+
- name: dependabot.yml file Output Test
119+
run: echo ${{ steps.dependabot_file.outputs.file_exists }}
120+
121+
- name: dependabot file exists with content
122+
if: steps.dependabot_file.outputs.file_exists == 'true'
123+
run: echo dependabot file exists!
124+
125+
- name: dependabot file does not exist
126+
if: steps.dependabot_file.outputs.file_exists == 'false'
127+
run: echo dependabot file does not exist!
128+
129+
check-for-codeql-file:
130+
runs-on: ubuntu-latest
131+
steps:
132+
133+
- name: Checkout repo
134+
uses: actions/checkout@v3
135+
136+
- name: Check for codeql-analysis.yml
137+
id: codeql-analysis_file
138+
uses: initialstate/file-check-action@v1
139+
with:
140+
file: ".github/workflows/codeql-analysis.yml"
141+
142+
- name: codeql-analysis.yml file Output Test
143+
run: echo ${{ steps.codeql-analysis_file.outputs.file_exists }}
144+
145+
- name: codeql-analysis file exists with content
146+
if: steps.codeql-analysis_file.outputs.file_exists == 'true'
147+
run: echo codeql-analysis file exists!
148+
149+
- name: codeql-analysis file does not exist
150+
if: steps.codeql-analysis_file.outputs.file_exists == 'false'
151+
run: echo codeql-analysis file does not exist!
152+
153+
check-for-personal-access-token:
154+
needs: public-or-private-repo
155+
if: needs.public-or-private-repo.outputs.repostate == 'public'
156+
runs-on: ubuntu-latest
157+
steps:
158+
159+
- name: Check for missing PERSONAL_ACCESS_TOKEN
160+
env:
161+
MY_KEY: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
162+
if: "${{ env.MY_KEY == '' }}"
163+
uses: actions/github-script@v6
164+
with:
165+
script: |
166+
core.setFailed('PERSONAL_ACCESS_TOKEN secret is missing. It is needed to successfully run the CLA assistant.')

0 commit comments

Comments
 (0)