Skip to content

Commit

Permalink
document examples, refresh README, prefer job-scoped permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
thepwagner committed Dec 18, 2023
1 parent df54b3b commit 2344fd7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 67 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build.yaml
@@ -1,23 +1,25 @@
name: Build
# Example repository: https://github.com/thepwagner-org/debian

on:
workflow_call:
secrets:
token:
required: true
description: GitHub token

permissions:
contents: read
packages: write
pull-requests: write
id-token: write
permissions: {}

env:
DOCKER_BUILDKIT: 1

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
id-token: write
steps:
- name: "🌎 Fetching code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/check.yaml
@@ -1,4 +1,5 @@
name: Check
# Example repository: https://github.com/thepwagner-org/debian

on:
workflow_call:
inputs:
Expand All @@ -17,14 +18,15 @@ on:
required: true
description: A non-Actions GitHub token, so Actions will react to pushes.

permissions:
contents: write
packages: read
pull-requests: write
permissions: {}

jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
pull-requests: write
steps:
- name: "🌎 Fetching code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/ci-golang.yaml

This file was deleted.

13 changes: 7 additions & 6 deletions .github/workflows/publish.yaml
@@ -1,23 +1,24 @@
name: Publish
# Example repository: https://github.com/thepwagner-org/debian

on:
workflow_call:
secrets:
token:
required: true
description: GitHub token

permissions:
contents: read
packages: write
id-token: write
permissions: {}

env:
DOCKER_BUILDKIT: 1

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
id-token: write
steps:
- name: "🌎 Fetching code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -8,7 +8,8 @@ These are GitHub Actions reusable workflows:
I'm currently using Trivy to generate SBOMs including vulnerabilty scans, and loving it!

You can see these in use in:
* https://github.com/thepwagner-org/debian-bullseye - base image
* https://github.com/thepwagner-org/debian - base image
* https://github.com/thepwagner-org/duplicity - consumer image
* https://github.com/thepwagner/github-token-factory-oidc - golang app

This repo is also a demonstration of versioning reusable workflows: changes are staged in the `main` branch, but most users of the workflows follow tagged releases and are pushed updates via RenovateBot pull request - [example](https://github.com/thepwagner-org/debian-bullseye/pull/162).

0 comments on commit 2344fd7

Please sign in to comment.