Skip to content

Commit 058a970

Browse files
committed
Add debugging instrumentation
1 parent 2b9b414 commit 058a970

6 files changed

Lines changed: 57 additions & 4 deletions

File tree

.github/actions/build-child-devcontainer/action.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
github-token:
2222
description: GitHub token
2323
required: true
24+
debug-input-chain:
25+
description: Enable extra debug logging for image tag input propagation and post-hook behavior
26+
required: false
27+
default: 'false'
2428

2529
runs:
2630
using: composite
@@ -77,12 +81,20 @@ runs:
7781
echo "tags=$TAGS" >> $GITHUB_OUTPUT
7882
shell: bash
7983

84+
- name: Probe augmented tags in child action
85+
if: inputs.debug-input-chain == 'true'
86+
uses: ./.github/actions/debug-post-input
87+
with:
88+
source: build-child-devcontainer/${{ inputs.image }}/augment-tags
89+
imageTag: ${{ steps.augment-tags.outputs.tags }}
90+
8091
- name: Build image
8192
uses: ./.github/actions/build-devcontainer
8293
with:
8394
image: ${{ inputs.image }}
84-
image-tags: ${{ steps.augment-tags.outputs.tags }}
95+
resolved-tags: ${{ steps.augment-tags.outputs.tags }}
8596
base-image-tag: ${{ inputs.base-image-tag }}
8697
push-image: ${{ inputs.push-image }}
8798
registry: ${{ inputs.registry }}
8899
github-token: ${{ inputs.github-token }}
100+
debug-input-chain: ${{ inputs.debug-input-chain }}

.github/actions/build-devcontainer/action.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
image:
55
description: Name of the image to build
66
required: true
7-
image-tags:
7+
resolved-tags:
88
description: Comma-separated tags to apply to the image
99
required: true
1010
push-image:
@@ -22,11 +22,20 @@ inputs:
2222
github-token:
2323
description: GitHub token
2424
required: true
25+
debug-input-chain:
26+
description: Enable extra debug logging for image tag input propagation and post-hook behavior
27+
required: false
28+
default: 'false'
2529

2630
runs:
2731
using: composite
2832
steps:
2933

34+
- name: Persist resolved tags
35+
run: |
36+
echo "BUILDCONTAINER_RESOLVED_TAGS=${{ inputs.resolved-tags }}" >> $GITHUB_ENV
37+
shell: bash
38+
3039
- name: Log in to registry
3140
if: inputs.push-image == 'true'
3241
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
@@ -35,13 +44,20 @@ runs:
3544
username: ${{ github.actor }}
3645
password: ${{ inputs.github-token }}
3746

47+
- name: Probe tags in build-devcontainer
48+
if: inputs.debug-input-chain == 'true'
49+
uses: ./.github/actions/debug-post-input
50+
with:
51+
source: build-devcontainer/${{ inputs.image }}
52+
imageTag: ${{ env.BUILDCONTAINER_RESOLVED_TAGS }}
53+
3854
- name: Build devcontainer image
3955
uses: devcontainers/ci@b63b30de439b47a52267f241112c5b453b673db5
4056
env:
4157
BASE_IMAGE_TAG: ${{ inputs.base-image-tag }}
4258
with:
4359
imageName: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image }}
44-
imageTag: ${{ inputs.image-tags }}
60+
imageTag: ${{ env.BUILDCONTAINER_RESOLVED_TAGS }}
4561
push: ${{ inputs.push-image == 'true' && 'always' || 'never' }}
4662
subFolder: ./src/${{ inputs.image }}
4763
cacheFrom: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Debug post input
2+
description: Log selected action inputs in main and post
3+
inputs:
4+
source:
5+
description: Logical source label for this probe
6+
required: true
7+
imageTag:
8+
description: Tag list to observe in main and post
9+
required: true
10+
runs:
11+
using: node24
12+
main: main.js
13+
post: post.js
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const source = process.env.INPUT_SOURCE || "";
2+
const imageTag = process.env.INPUT_IMAGETAG || "";
3+
4+
console.log(`[debug-post-input main] source=${source}`);
5+
console.log(`[debug-post-input main] INPUT_IMAGE_TAG=${imageTag}`);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const source = process.env.INPUT_SOURCE || "";
2+
const imageTag = process.env.INPUT_IMAGETAG || "";
3+
4+
console.log(`[debug-post-input post] source=${source}`);
5+
console.log(`[debug-post-input post] INPUT_IMAGE_TAG=${imageTag}`);

.github/workflows/build-devcontainers.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ jobs:
7979
uses: ./.github/actions/build-devcontainer
8080
with:
8181
image: base
82-
image-tags: ${{ needs.prepare-tags.outputs.tags }}
82+
resolved-tags: ${{ needs.prepare-tags.outputs.tags }}
8383
push-image: ${{ github.event_name != 'pull_request' }}
8484
github-token: ${{ secrets.GITHUB_TOKEN }}
85+
debug-input-chain: true
8586

8687
- name: Export base image for dependent jobs
8788
if: github.event_name == 'pull_request'
@@ -125,6 +126,7 @@ jobs:
125126
base-image-tag: ${{ needs.prepare-tags.outputs.base-image-tag }}
126127
push-image: ${{ github.event_name != 'pull_request' }}
127128
github-token: ${{ secrets.GITHUB_TOKEN }}
129+
debug-input-chain: true
128130

129131
cleanup-workflows:
130132
name: Cleanup workflows

0 commit comments

Comments
 (0)