diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db8fcc3587..be39432808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: | @@ -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 diff --git a/pkg/workflow/runtime_import_checkout_test.go b/pkg/workflow/runtime_import_checkout_test.go index 793631ccbe..b1d440561b 100644 --- a/pkg/workflow/runtime_import_checkout_test.go +++ b/pkg/workflow/runtime_import_checkout_test.go @@ -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 {