Skip to content

Add automated dist build workflow with PR verification#5

Draft
Copilot wants to merge 6 commits into
mainfrom
copilot/add-build-workflow-for-action
Draft

Add automated dist build workflow with PR verification#5
Copilot wants to merge 6 commits into
mainfrom
copilot/add-build-workflow-for-action

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 5, 2026

TypeScript GitHub Actions require committing compiled code in dist/. This PR adds automated workflows to build and commit the dist folder on pushes to main, while verifying dist is up-to-date on pull requests.

Changes

Automated Build Workflow (.github/workflows/build-dist.yml)

  • Automatically builds and commits dist/ when source files are pushed to main
  • Triggers on changes to src/, package.json, package-lock.json, or tsconfig.json
  • Uses [skip ci] to prevent infinite loops
  • Eliminates need for developers to manually build and commit compiled code

Build Verification Workflow (.github/workflows/build.yml)

  • Runs on pull requests to verify dist/ would be up-to-date before merge
  • Runs npm run all and fails if dist/ is out of sync with source
  • Prevents merging PRs with stale compiled code

Security Hardening

  • Added explicit permissions: contents: read to verification workflow per CodeQL recommendations
  • Added permissions: contents: write to automated build workflow for committing changes

Documentation

  • Added CONTRIBUTING.md with updated build requirements explaining automated builds
  • Updated README development section with detailed CI/CD workflow explanation
  • Clarified that manual builds are optional for contributors

Workflow Behavior

For Pull Requests:
Contributors who modify source without updating dist will see:

Error: dist folder is out of sync with source code
Please run 'npm run all' and commit the changes

For Main Branch:
When source changes are pushed to main, the workflow automatically:

  1. Builds the dist folder via npm run all
  2. Commits changes with message "chore: update dist folder [skip ci]"
  3. Pushes back to the repository

This approach allows contributors to focus on source code changes while CI handles compilation automatically.

Original prompt

Do we need a workflow do build / compile this action? (dist)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 5, 2026 14:07
- Add .github/workflows/build.yml to verify dist is up-to-date
- Update README.md with CI/CD section and build instructions
- Add CONTRIBUTING.md with detailed contributor guidelines
- Workflow checks that dist folder is in sync with source code
- Workflow runs tests to ensure code quality

Co-authored-by: woeterman94 <5755057+woeterman94@users.noreply.github.com>
- Set contents: read permission to follow security best practices
- Addresses CodeQL security alert about missing workflow permissions

Co-authored-by: woeterman94 <5755057+woeterman94@users.noreply.github.com>
- Set contents: read permission for all test jobs
- Ensures both workflows follow security best practices

Co-authored-by: woeterman94 <5755057+woeterman94@users.noreply.github.com>
Copilot AI changed the title [WIP] Add build workflow to compile action Add build workflow to verify compiled dist folder Feb 5, 2026
Copilot AI requested a review from woeterman94 February 5, 2026 14:15
@woeterman94
Copy link
Copy Markdown
Owner

@copilot I meant I need a workflow to generate the dist folder. How else should we update and build this action?

Co-authored-by: woeterman94 <5755057+woeterman94@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot I meant I need a workflow to generate the dist folder. How else should we update and build this action?

I've added a new workflow (.github/workflows/build-dist.yml) that automatically generates and commits the dist folder when you push to main.

How it works:

  • When source files are pushed to main, the workflow runs npm run all
  • If the dist folder changes, it commits and pushes it back automatically
  • The commit message includes [skip ci] to prevent infinite loops

The two workflows now serve different purposes:

  1. build-dist.yml - Automatically builds and commits dist on pushes to main
  2. build.yml - Verifies dist would be up-to-date on PRs (before merge)

This means contributors only need to commit source code changes - CI handles building the dist folder.

Commit: 3cb184c

Co-authored-by: woeterman94 <5755057+woeterman94@users.noreply.github.com>
Copilot AI changed the title Add build workflow to verify compiled dist folder Add automated dist build workflow with PR verification Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants