Skip to content

Commit 38475e6

Browse files
[setup](build): Actions(@RalphHightower/blog)
Signed-off-by: Ralph Hightower <[email protected]>
1 parent 0560b74 commit 38475e6

18 files changed

+276
-155
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
permissions:
2+
actions: read|write|none
3+
checks: read|write|none
4+
contents: read|write|none
5+
deployments: read|write|none
6+
issues: read|write|none
7+
packages: read|write|none
8+
pull-requests: read|write|none
9+
repository-projects: read|write|none
10+
security-events: read|write|none
11+
statuses: read|write|none
12+

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ jobs:
1515
runs-on: "ubuntu-latest"
1616
strategy:
1717
matrix:
18-
jekyll: ["~> 4.3.4"]
18+
jekyll: ["~> 4.3.4", "~>4.4.1"]
1919
env:
2020
JEKYLL_VERSION: ${{ matrix.jekyll }}
2121
steps:
22-
- name: Harden the runner (Audit all outbound calls)
22+
- name: Harden Runner
2323
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
2424
with:
2525
egress-policy: audit
2626

2727
- name: Checkout Repository
2828
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2929
- name: Set Up Ruby 3.4.7
30-
uses: ruby/setup-ruby@ae195bbe749a7cef685ac729197124a48305c1cb # v1.276.0
30+
uses: ruby/setup-ruby@4c24fa5ec04b2e79eb40571b1cee2a0d2b705771 # v1.278.0
3131
with:
3232
ruby-version: 3.4.7
3333
bundler-cache: true
34-
- name: Run tests
35-
run: script/cibuild
34+
# - name: Run tests
35+
# run: script/cibuild

.github/workflows/codeql.yml

Lines changed: 43 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,92 +9,70 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL Advanced"
12+
name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main", "main*" ]
16+
branches: ["main"]
1717
pull_request:
18-
branches: [ "main", "main*" ]
18+
# The branches below must be a subset of the branches above
19+
branches: ["main"]
1920
schedule:
20-
- cron: '43 4 * * 3'
21+
- cron: "0 0 * * 1"
2122

2223
permissions:
2324
contents: read
2425

2526
jobs:
2627
analyze:
27-
name: Analyze (${{ matrix.language }})
28-
# Runner size impacts CodeQL analysis time. To learn more, please see:
29-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
30-
# - https://gh.io/supported-runners-and-hardware-resources
31-
# - https://gh.io/using-larger-runners (GitHub.com only)
32-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
33-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
28+
name: Analyze
29+
runs-on: ubuntu-latest
3430
permissions:
35-
# required for all workflows
36-
security-events: write
37-
38-
# required to fetch internal or private CodeQL packs
39-
packages: read
40-
41-
# only required for workflows in private repositories
4231
actions: read
4332
contents: read
33+
security-events: write
4434

4535
strategy:
4636
fail-fast: false
4737
matrix:
48-
include:
49-
- language: ruby
50-
build-mode: none
51-
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
52-
# Use `c-cpp` to analyze code written in C, C++ or both
53-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
54-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
55-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
56-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
57-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
58-
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
38+
language: ["ruby"]
39+
# CodeQL supports [ $supported-codeql-languages ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
5942
steps:
60-
- name: Harden Runner
61-
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
62-
with:
63-
egress-policy: audit
43+
- name: Harden the runner (Audit all outbound calls)
44+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
45+
with:
46+
egress-policy: audit
47+
48+
- name: Checkout repository
49+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
50+
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
54+
with:
55+
languages: ${{ matrix.language }}
56+
# If you wish to specify custom queries, you can do so here or in a config file.
57+
# By default, queries listed here will override any specified in a config file.
58+
# Prefix the list here with "+" to use these queries and those in the config file.
6459

65-
- name: Checkout repository
66-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
60+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
61+
# If this step fails, then you should remove it and run the build manually (see below)
62+
- name: Autobuild
63+
uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
6764

68-
# Initializes the CodeQL tools for scanning.
69-
- name: Initialize CodeQL
70-
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
71-
with:
72-
languages: ${{ matrix.language }}
73-
build-mode: ${{ matrix.build-mode }}
74-
# If you wish to specify custom queries, you can do so here or in a config file.
75-
# By default, queries listed here will override any specified in a config file.
76-
# Prefix the list here with "+" to use these queries and those in the config file.
65+
# ℹ️ Command-line programs to run using the OS shell.
66+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
7767

78-
# For more 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
79-
# queries: security-extended,security-and-quality
68+
# If the Autobuild fails above, remove it and uncomment the following three lines.
69+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
8070

81-
# If the analyze step fails for one of the languages you are analyzing with
82-
# "We were unable to automatically build your code", modify the matrix above
83-
# to set the build mode to "manual" for that language. Then modify this step
84-
# to build your code.
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-
- if: matrix.build-mode == 'manual'
88-
shell: bash
89-
run: |
90-
echo 'If you are using a "manual" build mode for one or more of the' \
91-
'languages you are analyzing, replace this with the commands to build' \
92-
'your code, for example:'
93-
echo ' make bootstrap'
94-
echo ' make release'
95-
exit 1
71+
# - run: |
72+
# echo "Run, Build Application using script"
73+
# ./location_of_script_within_repo/buildscript.sh
9674

97-
- name: Perform CodeQL Analysis
98-
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
99-
with:
100-
category: "/language:${{matrix.language}}"
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
77+
with:
78+
category: "/language:${{matrix.language}}"

.github/workflows/dependabot.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Basic `dependabot.yml` file with
2+
# minimum configuration for two package managers
3+
4+
version: 2
5+
updates:
6+
permissions:
7+
contents: write
8+
# Enable version updates for npm
9+
- package-ecosystem: "npm"
10+
# Look for `package.json` and `lock` files in the `root` directory
11+
directory: "/"
12+
# Check the npm registry for updates every day (weekdays)
13+
schedule:
14+
interval: "daily"
15+
commit-message:
16+
prefix: "[info](sec) npm:"
17+
18+
# Enable version updates for Ruby
19+
- package-ecosystem: "bundler"
20+
# Look for `Ruby Gems` in the following directories
21+
directories:
22+
- "/"
23+
# - "_plugins"
24+
# Check for updates once a week
25+
schedule:
26+
interval: "daily"
27+
commit-message:
28+
prefix: "[info](sec) bundler:"
29+
30+
- package-ecosystem: github-actions
31+
directory: /
32+
schedule:
33+
interval: daily
34+
commit-message:
35+
prefix: "[info](sec) gh-actions:"

.github/workflows/dependency-review.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@
22
#
33
# This Action will scan dependency manifest files that change as part of a Pull Request,
44
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5-
# Once installed, if the workflow run is marked as required,
6-
# PRs introducing known-vulnerable packages will be blocked from merging.
5+
# Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable
6+
# packages will be blocked from merging.
77
#
88
# Source repository: https://github.com/actions/dependency-review-action
9-
name: 'dependency – Dependency Review'
10-
on: [pull_request]
9+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
10+
name: 'Dependency review'
11+
on:
12+
pull_request:
13+
branches: [ "main", "main*" ]
1114

15+
# If using a dependency submission action in this workflow this permission will need to be set to:
16+
#
17+
# permissions:
18+
# contents: write
19+
#
20+
# https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api
1221
permissions:
1322
contents: read
23+
# Write permissions for pull-requests are required for using the `comment-summary-in-pr` option, comment out if you aren't using this option
24+
pull-requests: write
1425

1526
jobs:
1627
dependency-review:
@@ -21,7 +32,13 @@ jobs:
2132
with:
2233
egress-policy: audit
2334

24-
- name: 'Checkout Repository'
35+
- name: 'Checkout repository'
2536
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2637
- name: 'Dependency Review'
2738
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
39+
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
40+
with:
41+
comment-summary-in-pr: always
42+
# fail-on-severity: moderate
43+
# deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
44+
# retry-on-snapshot-warnings: true

.github/workflows/issueQuarterlyRelease.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,41 @@ on:
77
- cron: 30 5 31 12 *
88
#workflow_dispatch:
99

10-
permissions: read-all
10+
permissions:
11+
contents: read
1112

1213
jobs:
1314
create-issue:
1415
runs-on: ubuntu-latest
1516
permissions:
1617
issues: write
18+
1719
steps:
1820
- name: Harden the runner (Audit all outbound calls)
1921
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
2022
with:
2123
egress-policy: audit
2224

2325
- name: Create Quarterly Release
24-
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
25-
with:
26-
title: "Issue Quarterly Release"
27-
content-filepath: .github/quarterlyRelease.md
28-
assignees: RalphHightower
29-
labels: |
30-
maintenance
31-
license
26+
run: |
27+
new_issue_url=$(gh issue create \
28+
--title "$TITLE" \
29+
--assignee "$ASSIGNEES" \
30+
--label "$LABELS" \
31+
--body "$BODY")
32+
if [[ $PINNED == true ]]; then
33+
gh issue pin "$new_issue_url"
34+
fi
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
GH_REPO: ${{ github.repository }}
38+
TITLE: "Maintenance: Quarterly Release"
39+
ASSIGNEES: "RalphHightower"
40+
LABELS: "maintenance,release – minor"
41+
BODY: |
42+
# Quarterly Release
43+
44+
- [ ] Create Quarterly Release.
45+
46+
PINNED: false
47+
CLOSE_PREVIOUS: false

.github/workflows/jekyll.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ jobs:
3131
build:
3232
runs-on: ubuntu-22.04
3333
steps:
34-
- name: Harden the runner (Audit all outbound calls)
34+
- name: Harden Runner
3535
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
3636
with:
3737
egress-policy: audit
3838

3939
- name: Checkout
4040
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141
- name: Setup Ruby
42-
uses: ruby/setup-ruby@ae195bbe749a7cef685ac729197124a48305c1cb # v1.276.0
42+
uses: ruby/setup-ruby@4c24fa5ec04b2e79eb40571b1cee2a0d2b705771 # v1.278.0
4343
with:
4444
ruby-version: '3.4.7' # Not needed with a .ruby-version file
4545
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
46-
cache-version: 1 # Increment this number if you need to re-download cached gems
46+
cache-version: 5 # Increment this number if you need to re-download cached gems
4747
- name: Setup Pages
4848
id: pages
4949
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
@@ -66,11 +66,11 @@ jobs:
6666
runs-on: ubuntu-latest
6767
needs: build
6868
steps:
69-
- name: Harden the runner (Audit all outbound calls)
69+
- name: Harden Runner
7070
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
7171
with:
7272
egress-policy: audit
7373

7474
- name: Deploy to GitHub Pages
7575
id: deployment
76-
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
76+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

0 commit comments

Comments
 (0)