From c40abcd771bc22e197d55820d90cc9f6587ef305 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Mon, 9 Mar 2026 22:45:00 +0900 Subject: [PATCH 1/5] fix: propagate skipBotEvents to install/build env --- action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.yml b/action.yml index c3a857c..ae08b84 100644 --- a/action.yml +++ b/action.yml @@ -148,6 +148,9 @@ runs: - name: Install dependencies if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} shell: bash + env: + SKIP_BOT_EVENTS: ${{ inputs.skipBotEvents }} + GITHUB_REF_NAME: ${{ steps.resolve_refs.outputs.source_ref }} run: | bun install --frozen-lockfile @@ -167,6 +170,9 @@ runs: - name: Build project if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} shell: bash + env: + SKIP_BOT_EVENTS: ${{ inputs.skipBotEvents }} + GITHUB_REF_NAME: ${{ steps.resolve_refs.outputs.source_ref }} run: | echo "Deleting previous dist..." rm -rf "${{ github.workspace }}/dist" From dc9912f79009b805dcbf251d6df5ebc32fbd6cc4 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Mon, 9 Mar 2026 22:55:13 +0900 Subject: [PATCH 2/5] refactor: export skipBotEvents once via GITHUB_ENV --- action.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index ae08b84..09d9bf5 100644 --- a/action.yml +++ b/action.yml @@ -145,12 +145,16 @@ runs: - uses: oven-sh/setup-bun@v2 if: ${{ steps.resolve_refs.outputs.should_skip != 'true' }} + - name: Export manifest env for lifecycle scripts + if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} + shell: bash + run: | + echo "SKIP_BOT_EVENTS=${{ inputs.skipBotEvents }}" >> "$GITHUB_ENV" + echo "GITHUB_REF_NAME=${{ steps.resolve_refs.outputs.source_ref }}" >> "$GITHUB_ENV" + - name: Install dependencies if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} shell: bash - env: - SKIP_BOT_EVENTS: ${{ inputs.skipBotEvents }} - GITHUB_REF_NAME: ${{ steps.resolve_refs.outputs.source_ref }} run: | bun install --frozen-lockfile @@ -170,9 +174,6 @@ runs: - name: Build project if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} shell: bash - env: - SKIP_BOT_EVENTS: ${{ inputs.skipBotEvents }} - GITHUB_REF_NAME: ${{ steps.resolve_refs.outputs.source_ref }} run: | echo "Deleting previous dist..." rm -rf "${{ github.workspace }}/dist" From 04f39f3be66cb242be9c5145716daab80b4be834 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Mon, 9 Mar 2026 22:57:52 +0900 Subject: [PATCH 3/5] fix: finalize manifest after build to preserve skipBotEvents --- action.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index 09d9bf5..c68f72a 100644 --- a/action.yml +++ b/action.yml @@ -145,13 +145,6 @@ runs: - uses: oven-sh/setup-bun@v2 if: ${{ steps.resolve_refs.outputs.should_skip != 'true' }} - - name: Export manifest env for lifecycle scripts - if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} - shell: bash - run: | - echo "SKIP_BOT_EVENTS=${{ inputs.skipBotEvents }}" >> "$GITHUB_ENV" - echo "GITHUB_REF_NAME=${{ steps.resolve_refs.outputs.source_ref }}" >> "$GITHUB_ENV" - - name: Install dependencies if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} shell: bash @@ -198,6 +191,19 @@ runs: sed -i 's/__dirname/import.meta.dirname/g' "${{ github.workspace }}/dist/plugin/index.js" fi + - name: Finalize manifest configuration JSON + if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} + shell: bash + env: + MANIFEST_PATH: ${{ inputs.manifestPath }} + SKIP_BOT_EVENTS: ${{ inputs.skipBotEvents }} + EXCLUDE_SUPPORTED_EVENTS: ${{ inputs.excludeSupportedEvents }} + GITHUB_WORKSPACE: ${{ github.workspace }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_REF_NAME: ${{ steps.resolve_refs.outputs.source_ref }} + run: | + node ${{ github.action_path }}/.github/scripts/update-manifest.js + - name: Get GitHub App token if: env.APP_ID != '' && env.APP_PRIVATE_KEY != '' && steps.resolve_refs.outputs.should_skip != 'true' uses: actions/create-github-app-token@v1 From fe114c037749c9cf925fa713b56ac8ad35f04eaf Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Wed, 11 Mar 2026 21:37:41 +0900 Subject: [PATCH 4/5] fix(artifact): publish dist index.cjs entrypoint --- action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3bde253..a9cf1b0 100644 --- a/action.yml +++ b/action.yml @@ -221,7 +221,7 @@ runs: cd ${{ github.action_path }} bun install - - name: Inject reassembly code into dist/index.js + - name: Inject reassembly entrypoints if: ${{ inputs.action == 'publish' && steps.resolve_refs.outputs.should_skip != 'true' }} shell: bash env: @@ -232,9 +232,16 @@ runs: printf '{"type":"module"}\n' > dist/plugin/package.json fi cp "${{ github.action_path }}/.github/scripts/reassembly-esm.js" dist/index.js + cat > dist/index.cjs <<'EOF' + import("./index.js").catch((error) => { + console.error("Failed to load dist/index.js from CJS bridge:", error); + process.exit(1); + }); + EOF cp dist/plugin/package.json dist/package.json else cp "${{ github.action_path }}/.github/scripts/reassembly-cjs.js" dist/index.js + cp "${{ github.action_path }}/.github/scripts/reassembly-cjs.js" dist/index.cjs fi - name: Publish manifest.json and dist to artifact branch From 5073aafb31a4635ad6e95d3b034611ba7b152f16 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Wed, 11 Mar 2026 21:39:59 +0900 Subject: [PATCH 5/5] fix(ci): avoid heredoc parsing in CJS bridge generation --- action.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index a9cf1b0..a7c4f4a 100644 --- a/action.yml +++ b/action.yml @@ -232,12 +232,11 @@ runs: printf '{"type":"module"}\n' > dist/plugin/package.json fi cp "${{ github.action_path }}/.github/scripts/reassembly-esm.js" dist/index.js - cat > dist/index.cjs <<'EOF' - import("./index.js").catch((error) => { - console.error("Failed to load dist/index.js from CJS bridge:", error); - process.exit(1); - }); - EOF + printf '%s\n' \ + 'import("./index.js").catch((error) => {' \ + ' console.error("Failed to load dist/index.js from CJS bridge:", error);' \ + ' process.exit(1);' \ + '});' > dist/index.cjs cp dist/plugin/package.json dist/package.json else cp "${{ github.action_path }}/.github/scripts/reassembly-cjs.js" dist/index.js