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
111 changes: 0 additions & 111 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -270,17 +260,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ matrix.test-group.name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-${{ matrix.test-group.name }}-
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -459,16 +438,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -727,16 +696,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -928,16 +887,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -1032,16 +981,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -1102,16 +1041,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -1226,16 +1155,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -1305,16 +1224,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down Expand Up @@ -1648,16 +1557,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
shell: bash
run: |
Expand Down Expand Up @@ -1780,16 +1679,6 @@ jobs:
go-version-file: go.mod
cache: true

- name: Cache Go modules (explicit fallback)
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-modules-

- name: Report Go cache status
run: |
if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then
Expand Down
37 changes: 37 additions & 0 deletions pkg/workflow/runtime_import_checkout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,43 @@ import (
"github.com/github/gh-aw/pkg/testutil"
)

// containsRuntimeImports checks if the content contains runtime-import macros
// with local file paths (starting with . or ..) rather than URLs
func containsRuntimeImports(content string) bool {
// Look for {{#runtime-import or {{#runtime-import? patterns
lines := strings.Split(content, "\n")
for _, line := range lines {
// Check for runtime-import or runtime-import? patterns
if strings.Contains(line, "{{#runtime-import") {
// Extract the part after runtime-import
idx := strings.Index(line, "{{#runtime-import")
if idx == -1 {
continue
}

// Find the path after the macro name
rest := line[idx+len("{{#runtime-import"):]

// Skip optional marker if present
rest = strings.TrimPrefix(rest, "?")

// Trim whitespace
rest = strings.TrimSpace(rest)

// Skip URLs (http:// or https://)
if strings.HasPrefix(rest, "http://") || strings.HasPrefix(rest, "https://") {
continue
}

// Check if it starts with . or .. (local file path)
if strings.HasPrefix(rest, ".") {
return true
}
}
}
return false
}

// TestContainsRuntimeImports tests the containsRuntimeImports function
func TestContainsRuntimeImports(t *testing.T) {
tests := []struct {
Expand Down