ci(gateway): pin candidate actions
Verify Data Plane / gateway (push) Canceled after 2m1s

This commit is contained in:
sechmachine
2026-07-30 15:18:54 +07:00
parent f31cf5d68f
commit bdddd24436
2 changed files with 26 additions and 4 deletions
+22
View File
@@ -1,15 +1,37 @@
package gateway
import (
"bufio"
"bytes"
"debug/buildinfo"
"debug/elf"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"testing"
)
func TestCIActionReferencesAreImmutable(t *testing.T) {
workflow, err := os.Open(filepath.Join("..", ".gitea", "workflows", "verify.yml"))
if err != nil {
t.Fatal(err)
}
defer workflow.Close()
immutable := regexp.MustCompile(`@[0-9a-f]{40}(?:\s+#.*)?$`)
scanner := bufio.NewScanner(workflow)
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
if strings.HasPrefix(line, "- uses:") && !immutable.MatchString(line) {
t.Errorf("mutable CI action reference: %s", line)
}
}
if err := scanner.Err(); err != nil {
t.Fatal(err)
}
}
func TestGatewayLinuxArtifactsAreReproduciblePureGoELF(t *testing.T) {
first, second := t.TempDir(), t.TempDir()
for _, output := range []string{first, second} {