Skip to content

Commit c97bfc0

Browse files
author
Genevieve Nuebel
committed
Fix sandbox Issues 7-9 from Scenario 1 findings
1 parent 579812b commit c97bfc0

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

β€Ž.github/workflows/test-auto-generate.ymlβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ jobs:
287287
with:
288288
token: ${{ steps.generate_token.outputs.token }}
289289
event-type: test_push_to_branch
290+
client-payload: '{"versions": "${{ needs.Setup.outputs.versions_to_generate }}"}'
290291

291292
- name: Summary
292293
run: |

β€Ž.github/workflows/test-on-push.ymlβ€Ž

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,51 @@ jobs:
3939
echo "βœ… No skip flag - proceeding with publish/release"
4040
fi
4141
42-
# Detect which test API versions were modified in this push
42+
# Detect which test API versions were modified
43+
# On repository_dispatch: versions come from client payload (paths-filter can't
44+
# detect changes correctly because dispatch runs on master, not test-auto-generate)
45+
# On push: use paths-filter as normal (push events have correct git context)
46+
# NOTE: This is a SANDBOX-ONLY workaround. Production on-push-master.yml does NOT
47+
# need this because both push and dispatch target master (same branch = correct context).
4348
detect-changes:
4449
runs-on: ubuntu-latest
4550
outputs:
46-
test_v20111101: ${{ steps.filter.outputs.test_v20111101 }}
47-
test_v20250224: ${{ steps.filter.outputs.test_v20250224 }}
51+
test_v20111101: ${{ steps.result.outputs.test_v20111101 }}
52+
test_v20250224: ${{ steps.result.outputs.test_v20250224 }}
4853
steps:
4954
- uses: actions/checkout@v3
50-
- uses: dorny/paths-filter@v2
55+
- name: Detect from dispatch payload
56+
id: dispatch
57+
if: github.event_name == 'repository_dispatch'
58+
run: |
59+
VERSIONS="${{ github.event.client_payload.versions }}"
60+
echo "πŸ“‹ Dispatch payload versions: $VERSIONS"
61+
[[ "$VERSIONS" == *"v20111101"* ]] && echo "test_v20111101=true" >> $GITHUB_OUTPUT || echo "test_v20111101=false" >> $GITHUB_OUTPUT
62+
[[ "$VERSIONS" == *"v20250224"* ]] && echo "test_v20250224=true" >> $GITHUB_OUTPUT || echo "test_v20250224=false" >> $GITHUB_OUTPUT
63+
- name: Detect from push paths
5164
id: filter
65+
if: github.event_name == 'push'
66+
uses: dorny/paths-filter@v2
5267
with:
5368
filters: |
5469
test_v20111101:
5570
- 'test-v20111101/**'
5671
test_v20250224:
5772
- 'test-v20250224/**'
73+
- name: Set outputs
74+
id: result
75+
run: |
76+
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
77+
echo "test_v20111101=${{ steps.dispatch.outputs.test_v20111101 }}" >> $GITHUB_OUTPUT
78+
echo "test_v20250224=${{ steps.dispatch.outputs.test_v20250224 }}" >> $GITHUB_OUTPUT
79+
echo "πŸ“‹ Using dispatch-based detection"
80+
else
81+
echo "test_v20111101=${{ steps.filter.outputs.test_v20111101 }}" >> $GITHUB_OUTPUT
82+
echo "test_v20250224=${{ steps.filter.outputs.test_v20250224 }}" >> $GITHUB_OUTPUT
83+
echo "πŸ“‹ Using paths-filter-based detection"
84+
fi
85+
echo "πŸ“‹ test_v20111101=${{ steps.dispatch.outputs.test_v20111101 || steps.filter.outputs.test_v20111101 }}"
86+
echo "πŸ“‹ test_v20250224=${{ steps.dispatch.outputs.test_v20250224 || steps.filter.outputs.test_v20250224 }}"
5887
5988
# Simulated publish and release for each version conditionally
6089
# Same conditional structure as production but echoes success instead of real npm publish/GitHub release

0 commit comments

Comments
Β (0)