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
41 changes: 41 additions & 0 deletions .github/workflows/check-action-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check actions dist sync

on:
pull_request:
paths:
- "actions/*/src/**"
- "actions/*/package.json"
- "actions/*/package-lock.json"
- "actions/*/tsconfig.json"
- "actions/*/mise.toml"
- "mise.toml"

jobs:
verify:
runs-on: ubuntu-latest
env:
MISE_EXPERIMENTAL: "1"
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: 🛠️ Setup mise
uses: jdx/mise-action@v2
with:
install: true
cache: true
experimental: true

- name: 📦 Install deps
run: mise run setup

- name: 🔨 Build all actions
run: mise run build

- name: 🧪 Verify dist is in sync with src
run: |
if ! git diff --exit-code 'actions/*/dist'; then
echo "::error::dist/ is out of sync with src/. Run 'mise run build' locally and commit the result."
git diff 'actions/*/dist' | head -200
exit 1
fi
180 changes: 10 additions & 170 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,179 +1,19 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache
.turbo

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

# Dependencies
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files
# Logs
*.log

# Env
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
.env.*.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
# OS
.DS_Store

# Bun
# TypeScript
*.tsbuildinfo

*.bun-build
# mise local overrides
mise.local.toml
40 changes: 33 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
# Github Actions
# Variable Land — GitHub Actions

## List
Reusable GitHub Actions used across Variable Land projects.

- [Setup pnpm](./actions/setup-pnpm/README.md)
- [Setup bun](./actions/setup-bun/README.md)
- [Setup pnpm + bun](./actions/setup-pnpm-bun/README.md)
- [Monorepo preview release](./actions/monorepo-preview-release/README.md)
- [Railway redeploy](./actions/railway-redeploy/README.md)
## Actions

| Action | Description |
| --- | --- |
| [`monorepo-preview-release`](./actions/monorepo-preview-release/README.md) | Publish a per-PR preview release of changed packages in a pnpm monorepo to npm (OIDC-first, with optional `NPM_TOKEN` fallback) and notify [`vland-bot`](https://bot.variable.land) so it can comment on the PR. |
| [`railway-redeploy`](./actions/railway-redeploy/README.md) | Trigger a redeploy of a Railway service via the Railway GraphQL API. Resolves the target service from `project_id` + `environment` + `service_name`, so no service ID lookup is needed. |
| [`setup-pnpm`](./actions/setup-pnpm/README.md) | Install pnpm, upgrade npm, cache the pnpm store, and install dependencies. |
| [`setup-bun`](./actions/setup-bun/README.md) | Install Bun pinned to the version in `.bun-version`. |
| [`setup-pnpm-bun`](./actions/setup-pnpm-bun/README.md) | Combined `setup-pnpm` + `setup-bun` for workflows that need both runtimes. |

## Versioning

Pin actions to a tag or commit SHA when you need stability:

```yml
uses: variableland/gh-actions/actions/<action-name>@<tag-or-sha>
```

`@main` tracks the latest changes on the default branch.

## Node action convention

Every Node-based action in this monorepo follows the same shape:

1. **`action.yml`** declares `runs.using: node24` and `main: dist/index.js`.
2. **Source** lives in `src/`. The bundled output (`dist/index.js`) is committed to the repo and runs directly on the GitHub Actions runner — no Docker build, no install at runtime.
3. **`mise.toml`** declares a `build` task that runs `ncc build src/index.ts -o dist`. Mise's incremental `sources`/`outputs` tracking skips the rebuild when nothing has changed.
4. The **lefthook `pre-push` hook** runs `mise run build` for any push that touches `actions/*/src/**` and blocks the push if `dist/` is out of sync with `src/`.
5. The CI workflow **`Check actions dist sync`** enforces the same invariant on every PR and is required by branch protection. Anyone who bypasses the local hook still gets caught here.

To add a new Node action, copy the structure of `monorepo-preview-release` or `railway-redeploy`, adjust inputs and logic, and run `mise run build` (or just `git push` — the hook will do it for you and tell you to commit the dist change).
5 changes: 5 additions & 0 deletions actions/monorepo-preview-release/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Dependencies
node_modules/

# TypeScript
*.tsbuildinfo
Loading
Loading