From 176409dc26df1c3235b2e940d475b627563f8cae Mon Sep 17 00:00:00 2001 From: Haseeb Malik Date: Tue, 21 Jul 2026 11:27:44 -0400 Subject: [PATCH 1/2] Add capitalized Dockerfile so the local action ref builds --- .github/workflows/e2e.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a7e2d76..b353679 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -43,6 +43,14 @@ jobs: ref: ${{ inputs.action_sha }} path: .e2e-action + - name: Make the action's Dockerfile resolvable + run: | + # action.yml wants Dockerfile but the repo ships it lowercase, and a local + # action ref is case-sensitive about it. + if [ ! -f .e2e-action/Dockerfile ] && [ -f .e2e-action/dockerfile ]; then + cp .e2e-action/dockerfile .e2e-action/Dockerfile + fi + - name: Link back to the pull request run: | echo "Testing [PR #${{ inputs.pr_number }}](https://github.com/DSACMS/automated-codejson-generator/pull/${{ inputs.pr_number }}) at \`${{ inputs.action_sha }}\`" >> "$GITHUB_STEP_SUMMARY" From 87f3ee95e12021e70d6efdb52a6734fa5ca85ed6 Mon Sep 17 00:00:00 2001 From: Haseeb Malik Date: Tue, 21 Jul 2026 11:53:38 -0400 Subject: [PATCH 2/2] Run validation mode via docker run so the event name actually applies --- .github/workflows/e2e.yml | 59 ++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b353679..06890fa 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -51,6 +51,9 @@ jobs: cp .e2e-action/dockerfile .e2e-action/Dockerfile fi + - name: Build the action image + run: docker build -t codejson-action .e2e-action + - name: Link back to the pull request run: | echo "Testing [PR #${{ inputs.pr_number }}](https://github.com/DSACMS/automated-codejson-generator/pull/${{ inputs.pr_number }}) at \`${{ inputs.action_sha }}\`" >> "$GITHUB_STEP_SUMMARY" @@ -59,14 +62,15 @@ jobs: run: cp e2e/fixtures/code.json.good code.json - name: Validate the good code.json - uses: ./.e2e-action - env: - # The action validates instead of generating when it sees a pull_request - # event. That is the only switch for this mode, so we set it directly. - GITHUB_EVENT_NAME: pull_request - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: main + run: | + # GITHUB_EVENT_NAME can't be set through uses:, so run the image ourselves + # to put the action in validation mode. + docker run --rm \ + -e GITHUB_EVENT_NAME=pull_request \ + -e GITHUB_ACTION=e2e \ + -e INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ + -v "${{ github.workspace }}:/github/workspace" \ + codejson-action - name: Stage a broken code.json run: cp e2e/fixtures/code.json.broken code.json @@ -74,12 +78,13 @@ jobs: - name: Validate the broken code.json id: validate_broken continue-on-error: true - uses: ./.e2e-action - env: - GITHUB_EVENT_NAME: pull_request - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: main + run: | + docker run --rm \ + -e GITHUB_EVENT_NAME=pull_request \ + -e GITHUB_ACTION=e2e \ + -e INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ + -v "${{ github.workspace }}:/github/workspace" \ + codejson-action - name: Assert the broken code.json was rejected run: | @@ -132,12 +137,13 @@ jobs: jq -e '.date.metadataLastUpdated | length > 0' code.json > /dev/null - name: Validate the generated code.json - uses: ./.e2e-action - env: - GITHUB_EVENT_NAME: pull_request - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: main + run: | + docker run --rm \ + -e GITHUB_EVENT_NAME=pull_request \ + -e GITHUB_ACTION=e2e \ + -e INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ + -v "${{ github.workspace }}:/github/workspace" \ + codejson-action - name: Restore a valid code.json run: cp e2e/fixtures/code.json.good code.json @@ -178,12 +184,13 @@ jobs: echo "Pushed ${COMMIT_SHA} to main." - name: Validate the pushed code.json - uses: ./.e2e-action - env: - GITHUB_EVENT_NAME: pull_request - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: main + run: | + docker run --rm \ + -e GITHUB_EVENT_NAME=pull_request \ + -e GITHUB_ACTION=e2e \ + -e INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ + -v "${{ github.workspace }}:/github/workspace" \ + codejson-action - name: Reset the sandbox if: always()