Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
cooldown:
default-days: 7
groups:
github-actions:
patterns: ["*"]
39 changes: 35 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
tags: ['*']
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -14,23 +17,51 @@ jobs:

actionlint:
name: Linting
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Register actionlint problem matcher
run: echo "::add-matcher::.github/actionlint-matcher.json"
# Keep the version in step with ACTIONLINT_TAG_VERSION in Taskfile.dist.yml.
- name: Run actionlint
uses: docker://rhysd/actionlint:latest
uses: docker://rhysd/actionlint:1.7.12@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
with:
args: -color
- name: No references to this repository by tag
run: |
if grep -rnE 'uses:[[:space:]]*specsnl/github-actions/' .github/workflows; then
echo "::error::A workflow references this repository by tag. Use a local path, or add a check that the tag matches the release."
exit 1
fi

zizmor:
name: zizmor
runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Keep the version in step with ZIZMOR_VERSION in Taskfile.dist.yml.
- name: Run zizmor
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
with:
version: 1.32.0
advanced-security: false
annotations: true

bake-tests:
name: Bake tests
runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run the specs.hcl fixture tests
Expand Down
86 changes: 32 additions & 54 deletions .github/workflows/notify-slack-tag.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,51 @@
name: Notify Slack on Tag
name: Notify Slack on tag

on:
workflow_call:
inputs:
runs-on:
description: Runner name i.e. default runner "ubuntu-24.04"
description: Runner name.
type: string
required: true
channel:
description: Slack channel to notify i.e. "#releases"
type: string
default: "#releases"
default: ubuntu-26.04
secrets:
slack-webhook-url:
description: Slack Incoming Webhook URL
description: Slack incoming webhook URL. The webhook decides the channel.
required: true

permissions: {}

jobs:
notify:
name: Slack Notification
name: Slack notification
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 5
steps:

- name: Build the payload
env:
TAG: ${{ github.ref_name }}
REPOSITORY: ${{ github.repository }}
REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
ACTOR: ${{ github.actor }}
run: |
jq -n --arg tag "$TAG" --arg repository "$REPOSITORY" --arg url "$REPOSITORY_URL" --arg actor "$ACTOR" '{
text: "Tag `\($tag)` created in \($repository)",
blocks: [
{type: "section", text: {type: "mrkdwn", text: "*New tag created*"}},
{type: "section", fields: [
{type: "mrkdwn", text: "*Tag:*\n`\($tag)`"},
{type: "mrkdwn", text: "*Repository:*\n<\($url)|\($repository)>"},
{type: "mrkdwn", text: "*Created by:*\n\($actor)"}
]},
{type: "actions", elements: [
{type: "button", text: {type: "plain_text", text: "View Tag"}, url: "\($url)/releases/tag/\($tag | @uri)"}
]}
]
}' > "$RUNNER_TEMP/slack-payload.json"

- name: Send Slack notification
uses: slackapi/slack-github-action@v4
uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
with:
webhook: ${{ secrets.slack-webhook-url }}
webhook-type: incoming-webhook
payload: |
{
"channel": "${{ inputs.channel }}",
"text": "Tag `${{ github.ref_name }}` created in ${{ github.repository }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New tag created*"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Tag:*\n`${{ github.ref_name }}`"
},
{
"type": "mrkdwn",
"text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>"
},
{
"type": "mrkdwn",
"text": "*Created by:*\n${{ github.actor }}"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Tag"
},
"url": "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}"
}
]
}
]
}
payload-file-path: ${{ runner.temp }}/slack-payload.json
10 changes: 10 additions & 0 deletions Taskfile.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ version: "3"
silent: true

vars:
# Keep these in step with lint.yml.
ACTIONLINT_TAG_VERSION: "1.7.12"
SHELLCHECK_TAG_VERSION: "v0.11.0"
ZIZMOR_VERSION: "1.32.0"

tasks:
lint:
Expand All @@ -20,6 +22,14 @@ tasks:
koalaman/shellcheck:{{.SHELLCHECK_TAG_VERSION}}
bake/*/*.sh bake/test/*.sh

zizmor:
desc: Audit the GitHub Actions workflows using zizmor (online audits need GH_TOKEN)
cmd: docker run --rm
--env GH_TOKEN
--volume "{{.ROOT_DIR}}:/workdir"
--workdir /workdir
ghcr.io/zizmorcore/zizmor:{{.ZIZMOR_VERSION}} --no-progress .

test:
desc: Run the bake/specs.hcl fixture tests and the plan tests
cmds:
Expand Down
Loading