Skip to content

Commit

Permalink
Update to 24.04 runners
Browse files Browse the repository at this point in the history
Signed-off-by: Jauder Ho <jauderho@users.noreply.github.com>
  • Loading branch information
jauderho committed Jun 13, 2024
1 parent c0e29cb commit 6836145
Show file tree
Hide file tree
Showing 11 changed files with 303 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build:
name: Codespell
# Set the agent to run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Load all steps #
steps:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/codespell.yml-e
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Codespell

# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions

# Start the job on all push #
on:
push:
pull_request:
workflow_dispatch:

#concurrency:
# group: ${{ github.workflow }}
# cancel-in-progress: true

permissions: read-all

# Set the Job #
jobs:
build:
name: Codespell
# Set the agent to run on
runs-on: ubuntu-22.04

# Load all steps #
steps:
# Checkout the code base #
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v1
with:
egress-policy: block
disable-telemetry: true
allowed-endpoints:
github.com:443

- name: Checkout Code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v2.4.0
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

# Run Linter against code base #
- name: Codespell
uses: codespell-project/actions-codespell@94259cd8be02ad2903ba34a22d9c13de21a74461 # master
with:
check_filenames: true
ignore_words_file: .codespellignore
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:

jobs:
dependency-review:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v1
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/dependency-review.yml-e
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Dependency Review'
on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v1
with:
egress-policy: block
disable-telemetry: true
allowed-endpoints: >
api.github.com:443
github.com:443

- name: 'Checkout Repository'
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29

- name: 'Dependency Review'
uses: actions/dependency-review-action@0659a74c94536054bfa5aeb92241f70d680cc78e
2 changes: 1 addition & 1 deletion .github/workflows/gitlabsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions: read-all

jobs:
sync:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
name: Git Repo Sync
steps:
- name: Harden Runner
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/gitlabsync.yml-e
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://dev.to/brunorobert/github-and-gitlab-sync-44mn
# This pushes code from GitHub to Gitlab upon commit to GH
name: Gitlab Sync

on:
push:
branches:
- main
#delete: {}

permissions: read-all

jobs:
sync:
runs-on: ubuntu-22.04
name: Git Repo Sync
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v1
with:
egress-policy: block
disable-telemetry: true
allowed-endpoints:
github.com:443
gitlab.com:443

- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v3
with:
fetch-depth: 0

- uses: jauderho/git-repo-sync@6142c9cd8960dadc57d1190506d6c35ac5cee660 # v0.2.0
with:
# Such as https://github.com/wangchucheng/git-repo-sync.git
#target-url: ${{ secrets.GITLAB_URL }}
target-url: https://gitlab.com/${{ github.repository }}.git
# Such as wangchucheng
#target-username: ${{ secrets.GITLAB_USERNAME }}
target-username: ${{ github.actor }}
# You can store token in your project's 'Setting > Secrets' and reference the name here. Such as ${{ secrets.ACCESS\_TOKEN }}
target-token: ${{ secrets.GITLAB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Load all steps #
steps:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/linter.yml-e
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Linter GitHub Actions ##
name: Lint Code Base

# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions

# Start the job on all push #
on:
push:
pull_request:
workflow_dispatch:

#concurrency:
# group: ${{ github.workflow }}
# cancel-in-progress: true

permissions: read-all

# Set the Job #
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-22.04

# Load all steps #
steps:
# Checkout the code base #
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v1
with:
egress-policy: block
disable-telemetry: true
allowed-endpoints:
api.github.com:443
github.com:443
proxy.golang.org:443
pypi.org:443
zrdfepirv2blaprdstr01a.blob.core.windows.net:443

- name: Checkout Code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

# Run Linter against code base #
- name: Lint Code Base
#uses: github/super-linter@b8641364ca9a79b3cf07f3c4c59a82709cd39094 # v4
uses: github/super-linter/slim@4e51915f4a812abf59fed160bb14595c0a38a9e7 # v4
#uses: docker://ghcr.io/github/super-linter:slim-v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVASCRIPT_DEFAULT_STYLE: prettier

82 changes: 82 additions & 0 deletions .github/workflows/scorecard.yml-e
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Security Scorecard
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
# Weekly on Saturdays.
- cron: '30 1 * * 6'
push:
branches: [ main, master ]
workflow_dispatch:

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
id-token: write
actions: read
contents: read

steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v1
with:
disable-sudo: true
egress-policy: block
disable-telemetry: true
allowed-endpoints:
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
api.securityscorecards.dev:443
bestpractices.coreinfrastructure.org:443
codeload.github.com:443
github.com:443
fulcio.sigstore.dev:443
oauth2.sigstore.dev:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
sigstore-tuf-root.storage.googleapis.com:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443

- name: "Checkout code"
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v2.4.0
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534
with:
results_file: results.sarif
results_format: sarif
# Read-only PAT token. To create it,
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
repo_token: ${{ secrets.SCORECARD_TOKEN }}
#repo_token: ${{ secrets.GITHUB_TOKEN }}
# Publish the results for public repositories to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
#- name: "Upload artifact"
# uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1
# with:
# name: SARIF file
# path: results.sarif
# retention-days: 1

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions: read-all
jobs:
semgrep:
name: Scan
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/semgrep.yml-e
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Semgrep

on:
pull_request: {}
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
schedule:
- cron: '0 0 * * 0'
workflow_call:

permissions: read-all

jobs:
semgrep:
name: Scan
runs-on: ubuntu-22.04
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
actions: read
contents: read
container:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]')

steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v1
with:
egress-policy: audit
disable-telemetry: false
allowed-endpoints:
github.com:443
semgrep.dev:443

- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29

# Run Semgrep as CI
- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}

0 comments on commit 6836145

Please sign in to comment.