Centralized configurations and reusable GitHub Actions workflows for the gofiber organization.
Each workflow can be consumed from other repositories with:
jobs:
example:
uses: gofiber/.github/.github/workflows/<workflow-file>@main
# with: ...
# secrets: ...Runs golangci-lint with the same defaults as the gofiber repositories.
- Inputs:
go-version(default1.25.x),working-directory(default.),golangci-version(defaultv2.5.0),config-path(default.github/.golangci.yml),config-repository(defaultgofiber/.github),config-ref(defaultmain),use-shared-config(defaulttrue).
Runs gotestsum across the Go/test matrix used in gofiber/fiber by default.
- Inputs:
go-versionsJSON array (default["1.25.x"]),platformsJSON array (default["ubuntu-latest", "windows-latest", "macos-latest"]),working-directory(default.),package-pattern(default./...),codecov-flags(defaultunittests),codecov-slug(default${{ github.repository }}),enable-codecov(defaulttrue),enable-repeated(defaulttrue). - Secrets: optional
codecov-tokenwhen publishing coverage.
Runs markdownlint-cli2 against Markdown files.
- Inputs:
globs(newline-separated list) and optionalconfigpath. Defaults match the organization markdown workflow.
Runs Release Drafter with a configurable config path fetched from this repo by default.
- Inputs:
config-path(default.github/release-drafter.yml),config-repository(defaultgofiber/.github),config-ref(defaultmain). - Secrets: optional
release-tokenwithcontents:writepermission; otherwise uses the default token.
Applies labels from the shared configuration in this repository using the gofiber/multi-labeler action. The base configuration captures labels common to gofiber/contrib and gofiber/fiber; repository-specific rules (for example, versioned branches in gofiber/fiber) should be added via a repo-local labeler.yml that extends this shared file.
- Inputs:
config-path(default.github/labeler.yml),config-repository(defaultgofiber/.github),config-ref(defaultmain). - Secrets: optional
github-tokenwithpull_requests:writeandissues:write; otherwise uses the default token.
Automatically enables auto-merge on Dependabot pull requests.
- Inputs:
match_pattern(regex of status check names to wait for, defaulttest|discover|go),wait-delay(seconds before the first poll, default60). - Secrets:
github-tokenwithpull_requests:writeandcontents:write. Declared optional, but a PAT is required in practice: the Actions bot may not approve a pull request, so the default token cannot get the merge through. - Only runs when the actor is
dependabot[bot]. - Merges minor and patch updates, plus
github_actionsmajors - but not for four glue actions, and not in this repository, whose reusable workflows no pull request check here exercises.
Runs Go security checks.
- Inputs:
run-govulncheck(defaulttrue),run-codeql(defaultfalse),working-directory(default.),go-version(defaultstable). - CodeQL publishes results to code scanning when enabled.
Pushes documentation (or any directory) from the caller repository to another repository.
- Inputs:
source-path,destination-repo, optionaldestination-branch,destination-path,commit-message,git-user-name,git-user-email. - Secrets:
destination-tokenwith push access to the destination repository.
Runs a repository command when a maintainer comments a slash command on a pull request, then pushes whatever the command changed back onto the PR branch. Only the command and the script belong to the caller; the comment parsing, the permission gate, the reactions, the commit and the result comment live here. Unlike the other workflows in this repository a caller brings its own on:, concurrency: and permissions:, and is called pr-commands.yml because one caller can host several commands:
name: PR Commands
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened]
permissions:
contents: write
pull-requests: write
jobs:
hint:
if: github.event_name == 'pull_request_target'
uses: gofiber/.github/.github/workflows/pr-command-hint.yml@main
with:
hint: '`/tidy` runs go mod tidy on this branch'
tidy:
if: github.event_name == 'issue_comment'
# One group per command and pull request, so a second /tidy waits instead of
# racing the first one's push.
concurrency:
group: ${{ github.workflow }}-tidy-${{ github.event.issue.number }}
cancel-in-progress: false
uses: gofiber/.github/.github/workflows/pr-command.yml@main
with:
command: tidy
paths: go.mod go.sum
commit-message: 'chore: go mod tidy'
run: go mod tidy- Inputs:
command(the slash command without the slash),run(the script executed on the pull request head, with the words typed after the command in$ARGS),commit-message,paths(space separated pathspecs the command may change, default.),runs-on(defaultubuntu-latest),go-version(empty takes it fromgo.mod,noneskips the Go setup),timeout-minutes(default30). - Secrets: optional
push-token, a PAT with write access to the pull request head (gofiber/utilsandgofiber/fiberpass the org'sPR_TOKEN). Without it a fork branch cannot be pushed to and the patch is attached to the run instead, and because a push made withGITHUB_TOKENcreates no workflow run, the repository's checks keep showing the commit before it. Only the pushing job sees the PAT, and that job runs nothing from the pull request. - The command has to sit on a line of its own in the conversation tab, a review thread is not an
issue_comment, and the commenter needswrite,maintainoradminon the repository. Every run a maintainer starts answers with one comment; a comment from someone without write access only gets a reaction. - The words after the command reach
$ARGSonly if they are made of[A-Za-z0-9._,=:/+ -]; anything else is refused with a comment naming the reason. issue_commentalways runs the copy of the workflow on the default branch, so a caller cannot be tried out from the pull request that adds it: merge it first.pr-command-hint.yml(thehintjob above) appends one small line naming the commands to the description of every pull request a person opens. It sits apart frompr-command.ymlso a repository with several commands still gets a single line. The line lands in the description only, never in a commit: neither repository takes the description into its squash message.- In use:
gofiber/utilsfor/bench-readmeand/bench-readme-amd64,gofiber/fiberfor/generate.
This repository also stores configuration that should remain identical across gofiber projects:
.github/release-drafter.yml: Release Drafter template and categories used by therelease-drafterworkflow..github/labeler.yml: Label mappings used by theauto-labelerworkflow..github/.golangci.yml: golangci-lint rules used by thego-lintworkflow.
When consuming the corresponding workflows, the shared configuration is automatically fetched from this repository unless you override the inputs.