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
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

52 changes: 0 additions & 52 deletions .eslintrc.json

This file was deleted.

47 changes: 47 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# AGENTS.md

Guidance for coding agents working in this repository.

## Project summary

- **Name:** Crosspost Markdown
- **Type:** GitHub Action written in TypeScript
- **Entry point:** `src/main.ts`
- **Published artifact:** `dist/index.js` (bundled with `@vercel/ncc`)

## Local setup

1. Install dependencies:
- `npm install`
2. Run checks:
- `npm run build`
- `npm run lint`
- `npm test`

## Common commands

- `npm run build` — compile TypeScript
- `npm run lint` — run ESLint on `src/**/*.ts`
- `npm run test` — run Jest test suite
- `npm run package` — bundle action into `dist/index.js`
- `npm run all` — run build, format, lint, package, and tests

## Repository layout

- `src/` — action implementation
- `publish/` — publisher integrations (dev.to, medium)
- `__tests__/` — shared/fixture-driven tests
- `action.yml` — action metadata and inputs
- `dist/` — generated bundle committed for GitHub Actions runtime

## Dependency updates

- Use npm for dependency management.
- Update direct dependencies in `package.json`, then regenerate lockfile with `npm install`.
- After dependency changes, run `npm run build && npm run lint && npm test`.
- If runtime code changes are introduced, regenerate `dist/` with `npm run package`.

## Safety notes

- Do not commit secrets or API tokens.
- Treat `dist/` as generated output; keep it in sync with runtime changes.
3 changes: 3 additions & 0 deletions __mocks__/@actions/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export const getInput = (key: string) => {
switch (key) {
case 'dev-to-token':
return 'dev-to-token-testing';
case 'medium-token':
return '';
case 'github-token':
return 'gh-token-mock';
case 'content-dir':
Expand All @@ -17,3 +19,4 @@ export const getInput = (key: string) => {
};

export const info = jest.fn();
export const setFailed = jest.fn();
6 changes: 4 additions & 2 deletions __mocks__/@actions/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export const context = {

export const getOctokit = (token: string): any => {
return {
repos: {
getCommit: () => new Commit(),
rest: {
repos: {
getCommit: () => new Commit(),
},
},
};
};
Loading
Loading