Skip to content

Commit

Permalink
[setup](config): base_workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Hightower <32745442+RalphHightower@users.noreply.github.com>
  • Loading branch information
RalphHightower authored Dec 31, 2024
1 parent 4fca8a3 commit e07e7c4
Show file tree
Hide file tree
Showing 12 changed files with 357 additions and 20 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/GitHubActionPermissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: post
tags: []
categories: []
#date: 2019-06-25 13:14:15
#excerpt: ''
#image: 'BASEURL/assets/blog/img/.png'
#description:
#permalink:
title: 'title'
---


permissions:
actions: read|write|none
checks: read|write|none
contents: read|write|none
deployments: read|write|none
issues: read|write|none
packages: read|write|none
pull-requests: read|write|none
repository-projects: read|write|none
security-events: read|write|none
statuses: read|write|noner
19 changes: 11 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
name: Continuous Integration
name: ci.yml – Continuous Integration
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
permissions:
contents: read

jobs:
build:
name: "Test with Jekyll ${{ matrix.jekyll }}"
runs-on: "ubuntu-latest"
strategy:
matrix:
jekyll: ["~> 3.9", "~> 4.2"]
jekyll: ["~> 4.3.4"]
env:
JEKYLL_VERSION: ${{ matrix.jekyll }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Ruby 2.7
uses: ruby/setup-ruby@v1
uses: actions/checkout@v4.2.2
- name: Set Up Ruby 3.3.6
uses: ruby/setup-ruby@v1.206.0
with:
ruby-version: 2.7
ruby-version: 3.3.6
bundler-cache: true
- name: Run tests
run: script/cibuild
73 changes: 73 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
schedule:
- cron: "0 0 * * 1"

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["ruby"]
# CodeQL supports [ $supported-codeql-languages ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/autobuild@v2.19.4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3.27.4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2.19.3
with:
category: "/language:${{matrix.language}}"
22 changes: 22 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'dependency – Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4.2.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4.5.0
4 changes: 2 additions & 2 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Setup Ruby
uses: ruby/setup-ruby@v1.201.0
uses: ruby/setup-ruby@v1.206.0
with:
ruby-version: '3.3.6' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
Expand All @@ -44,7 +44,7 @@ jobs:
uses: actions/configure-pages@v5.0.0
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
run: bundle exec jekyll build --trace --incremental --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
JEKYLL_GITHUB_TOKEN: ${{secrets.JEKYLL_METADATA_TOKEN}}
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/permission_advisor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Sample workflow to run the action
name: permission_advisor.yml — Permissions Advisor

permissions:
actions: read

on:
workflow_dispatch:
inputs:
name:
description: 'The name of the workflow file to analyze'
required: true
type: string
count:
description: 'How many last runs to analyze'
required: false
type: number
default: 10

jobs:
advisor:
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/advisor@v1.0.2-beta5
with:
name: ${{ inputs.name }}
count: ${{ inputs.count }}
19 changes: 19 additions & 0 deletions .github/workflows/readme-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: readme-checker.yml – Checks for suggested markdown
on: [push, pull_request]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Checking markdown
uses: DavidAnson/markdownlint-cli2-action@v18.0.0
with:
globs: |
*.md
**/*.md
!test/*.md
21 changes: 14 additions & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
name: release-please.yml – Automate releases with Conventional Commit Messages.
on:
push:
branches:
- main

permissions:
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4.1.1
- uses: googleapis/release-please-action@4.1.3
with:
contents: write
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.GITHUB_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: simple
package-name: release-please-action
#...(same as above)
#steps:
# - uses: google-github-actions/release-please-action@v3
# with:
# command: manifest
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release.yml – Release
on:
push:
branches:
- main
- next
- beta
- "*.x"
permissions:
contents: read # for checkout
jobs:
release:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-node@v4.1.0
with:
cache: npm
node-version: lts/*
- run: npm clean-install
- run: corepack npm audit signatures
# pinned version updated automatically by Renovate.
# details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation
- run: npx semantic-release@v24.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: scorecard.yml — OpenSSF Scorecard
"on":
schedule:
- cron: 31 2 * * 1
push:
branches:
- main
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
security-events: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
with:
persist-credentials: false
- name: Run analysis
uses: ossf/scorecard-action@v2.4.0
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@v4.4.3
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@v2.20.0
with:
sarif_file: results.sarif
13 changes: 10 additions & 3 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.


name: Semantic Pull Request
name: systematic-release.yml – Pull Request

on:
pull_request:
Expand All @@ -29,12 +29,19 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
cancel-in-progress: true

permissions:
contents: read
# contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance name: Check pull request title

jobs:
main:
name: Check pull request title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5.5.3
name: semantic release
uses: amannn/action-semantic-pull-request@v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
Loading

0 comments on commit e07e7c4

Please sign in to comment.