Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/check-task-link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: check-task-link
on:
pull_request:
types: [opened, reopened, edited, synchronize, ready_for_review]

permissions:
contents: read

jobs:
task-link:
runs-on: ubuntu-latest
steps:
- name: "Require a Task: <task_identifier> line in the PR body"
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
# Anchored at the start of a line and case-sensitive on the key, so
# `subtask: <uuid>` and `not a task: <uuid>` cannot satisfy the gate.
# The UUID must also be the whole remainder of the line.
if printf '%s\n' "$PR_BODY" \
| grep -Eq '^[[:space:]]*Task:[[:space:]]*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[[:space:]]*$'; then
echo "PR body names a task identifier"
exit 0
fi
echo "::error::PR body has no 'Task: <task_identifier>' line. Add the vault task UUID on a line of its own."
exit 1
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
cache-dependency-path: go.sum

- name: Install Trivy
env:
TRIVY_VERSION: v0.76.2
TRIVY_SHA256: bc0fc726e017b8927a62b2d3531d7a84ee01769daf5c99ed866dced54089fdbf
run: |
sudo apt-get update
sudo apt-get install -y wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install -y trivy
curl -sfL "https://github.com/aquasecurity/trivy/releases/download/${TRIVY_VERSION}/trivy_${TRIVY_VERSION#v}_Linux-64bit.tar.gz" -o /tmp/trivy.tar.gz
echo "${TRIVY_SHA256} /tmp/trivy.tar.gz" | sha256sum -c -
sudo tar -xzf /tmp/trivy.tar.gz -C /usr/local/bin trivy

- name: Run precommit checks
env:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Please choose versions by [Semantic Versioning](http://semver.org/).
* MINOR version when you add functionality in a backwards-compatible manner, and
* PATCH version when you make backwards-compatible bug fixes.

## Unreleased

- feat: add a `check-task-link` gate that fails a PR whose body carries no `Task: <task_identifier>` line, and install a pinned, checksum-verified Trivy release so `test` stops failing on the retired keyring helper

## v0.51.3

- chore: update Go to 1.27.4
Expand Down
Loading