Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/pr-size-check-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: write
issues: write
pull-requests: write

jobs:
check-pr-size:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr-size-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: write
issues: write
pull-requests: write

jobs:
check-pr-size:
runs-on: ubuntu-latest
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
17 changes: 17 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
branches:
- main

plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/changelog'
- - '@semantic-release/npm'
- npmPublish: false
- - '@semantic-release/git'
- assets:
- package.json
- package-lock.json
- CHANGELOG.md
- dist/**/*
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
- '@semantic-release/github'
51 changes: 48 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,29 +122,74 @@ The action automatically creates the following labels:

```bash
npm install
npm run build
```

### Building

The action uses [@vercel/ncc](https://github.com/vercel/ncc) to compile the code and dependencies into a single file. This eliminates the need to commit `node_modules`.

```bash
npm run build
```

This creates a `dist/index.js` file that includes all dependencies bundled together.

### File Structure

```
github-custom-action-examples/
├── action.yml # Action metadata
├── index.js # Main logic
├── action.yml # Action metadata (points to dist/index.js)
├── index.js # Main logic (source)
├── dist/
│ └── index.js # Bundled code with dependencies (commit this!)
├── package.json # Dependencies
├── README.md # Documentation
└── .github/
└── workflows/
├── release.yml # Semantic Release workflow
├── pr-size-check.yml # Local usage example
└── pr-size-check-external.yml # External usage example
```

## Releases and Versioning

This project uses [Semantic Release](https://semantic-release.gitbook.io/) for automated versioning and releases.

### Commit Message Format

Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:

- `feat:` - A new feature (triggers minor version bump)
- `fix:` - A bug fix (triggers patch version bump)
- `docs:` - Documentation changes
- `chore:` - Maintenance tasks
- `BREAKING CHANGE:` - Breaking changes (triggers major version bump)

**Examples:**

```bash
feat: add support for custom label colors
fix: resolve issue with label removal
docs: update README with new examples
chore: update dependencies
```

### How It Works

1. Push commits to `main` branch using conventional commit format
2. Semantic Release analyzes commits and determines version bump
3. Automatically generates CHANGELOG.md
4. Creates a GitHub release with release notes
5. Updates version in package.json

## Contributing

Contributions are welcome! Please:

1. Fork the repository
2. Create a branch for your feature
3. Commit your changes
3. Commit your changes using conventional commit format
4. Open a Pull Request

## License
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ outputs:

runs:
using: 'node20'
main: 'index.js'
main: 'dist/index.js'
Loading