Skip to content

Commit 1679921

Browse files
[improve](build): standardize workflows
Signed-off-by: Ralph Hightower <[email protected]>
1 parent a7fb42b commit 1679921

File tree

12 files changed

+564
-0
lines changed

12 files changed

+564
-0
lines changed

.github/ci.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ci.yml – Continuous Integration
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: "Test with Jekyll ${{ matrix.jekyll }}"
15+
runs-on: "ubuntu-latest"
16+
strategy:
17+
matrix:
18+
jekyll: ["~> 4.3.4"]
19+
env:
20+
JEKYLL_VERSION: ${{ matrix.jekyll }}
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/[email protected]
24+
- name: Set Up Ruby 3.3.6
25+
uses: ruby/[email protected]
26+
with:
27+
ruby-version: 3.3.6
28+
bundler-cache: true
29+
- name: Run tests
30+
run: script/cibuild

.github/codeql.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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: ["main"]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: ["main"]
20+
schedule:
21+
- cron: "0 0 * * 1"
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
runs-on: ubuntu-latest
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
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+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/[email protected]
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/[email protected]
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
55+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
56+
# If this step fails, then you should remove it and run the build manually (see below)
57+
- name: Autobuild
58+
uses: github/codeql-action/[email protected]
59+
60+
# ℹ️ Command-line programs to run using the OS shell.
61+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
62+
63+
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
65+
66+
# - run: |
67+
# echo "Run, Build Application using script"
68+
# ./location_of_script_within_repo/buildscript.sh
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/[email protected]
72+
with:
73+
category: "/language:${{matrix.language}}"

.github/dependency-review.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# 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.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'dependency – Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 'Checkout Repository'
20+
uses: actions/[email protected]
21+
- name: 'Dependency Review'
22+
uses: actions/[email protected]

.github/jekyll.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
7+
name: jekyll.yml – Deploy Jekyll site to Pages
8+
9+
on:
10+
# Runs on pushes targeting the default branch
11+
push:
12+
branches: ["main", "_staging", "next"]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
23+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
24+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
25+
concurrency:
26+
group: "pages"
27+
cancel-in-progress: false
28+
29+
jobs:
30+
# Build job
31+
build:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/[email protected]
36+
- name: Setup Ruby
37+
uses: ruby/[email protected]
38+
with:
39+
ruby-version: '3.3.6' # Not needed with a .ruby-version file
40+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
41+
cache-version: 1 # Increment this number if you need to re-download cached gems
42+
- name: Setup Pages
43+
id: pages
44+
uses: actions/[email protected]
45+
- name: Build with Jekyll
46+
# Outputs to the './_site' directory by default
47+
run: bundle exec jekyll build --trace --incremental --baseurl "${{ steps.pages.outputs.base_path }}"
48+
env:
49+
JEKYLL_ENV: production
50+
JEKYLL_GITHUB_TOKEN: ${{secrets.JEKYLL_METADATA_TOKEN}}
51+
LOG_LEVEL: debug
52+
- name: Upload artifact
53+
# Automatically uploads an artifact from the './_site' directory by default
54+
uses: actions/[email protected]
55+
56+
# Deployment job
57+
deploy:
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
runs-on: ubuntu-latest
62+
needs: build
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/[email protected]

.github/permission_advisor.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Sample workflow to run the action
2+
name: permission_advisor.yml — Permissions Advisor
3+
4+
permissions:
5+
actions: read
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
name:
11+
description: 'The name of the workflow file to analyze'
12+
required: true
13+
type: string
14+
count:
15+
description: 'How many last runs to analyze'
16+
required: false
17+
type: number
18+
default: 10
19+
20+
jobs:
21+
advisor:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: GitHubSecurityLab/actions-permissions/[email protected]
25+
with:
26+
name: ${{ inputs.name }}
27+
count: ${{ inputs.count }}

.github/readme-checker.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: readme-checker.yml – Checks for suggested markdown
2+
on: [push, pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: Checking markdown
14+
uses: DavidAnson/[email protected]
15+
with:
16+
globs: |
17+
*.md
18+
**/*.md
19+
!test/*.md

.github/release-please.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: release-please.yml – Automate releases with Conventional Commit Messages.
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/[email protected]
17+
with:
18+
contents: write
19+
# this assumes that you have created a personal access token
20+
# (PAT) and configured it as a GitHub action secret named
21+
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
# this is a built-in strategy in release-please, see "Action Inputs"
24+
# for more options
25+
release-type: simple

.github/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: release.yml – Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- next
7+
- beta
8+
- "*.x"
9+
permissions:
10+
contents: read # for checkout
11+
jobs:
12+
release:
13+
permissions:
14+
contents: write # to be able to publish a GitHub release
15+
issues: write # to be able to comment on released issues
16+
pull-requests: write # to be able to comment on released pull requests
17+
id-token: write # to enable use of OIDC for npm provenance
18+
name: release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/[email protected]
22+
- uses: actions/[email protected]
23+
with:
24+
cache: npm
25+
node-version: lts/*
26+
- run: npm clean-install
27+
- run: corepack npm audit signatures
28+
# pinned version updated automatically by Renovate.
29+
# details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation
30+
- run: npx [email protected]
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }}

.github/scorecard.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: scorecard.yml — OpenSSF Scorecard
2+
"on":
3+
schedule:
4+
- cron: 31 2 * * 1
5+
push:
6+
branches:
7+
- main
8+
permissions: read-all
9+
jobs:
10+
analysis:
11+
name: Scorecard analysis
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
id-token: write
16+
steps:
17+
- name: Checkout code
18+
uses: actions/[email protected]
19+
with:
20+
persist-credentials: false
21+
- name: Run analysis
22+
uses: ossf/[email protected]
23+
with:
24+
results_file: results.sarif
25+
results_format: sarif
26+
publish_results: true
27+
- name: Upload artifact
28+
uses: actions/[email protected]
29+
with:
30+
name: SARIF file
31+
path: results.sarif
32+
retention-days: 5
33+
- name: Upload to code-scanning
34+
uses: github/codeql-action/[email protected]
35+
with:
36+
sarif_file: results.sarif

0 commit comments

Comments
 (0)