Skip to content

Commit 7604773

Browse files
Add initial implementation of CPython Patch PR Action with TypeScript scaffolding
1 parent 266934e commit 7604773

File tree

6 files changed

+206
-1
lines changed

6 files changed

+206
-1
lines changed

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: CPython Patch PR Action
2+
description: "Scaffolded placeholder for the CPython patch PR GitHub Action."
3+
author: Casper Kristiansson
4+
runs:
5+
using: node20
6+
main: dist/index.js
7+
defaults:
8+
run:
9+
shell: bash

docs/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Use Context7 MCP for up to date documentation.
6969
Files: `LICENSE` (MIT), `README.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, `CONTRIBUTING.md`, `.gitignore`.
7070
Verify: Repo visible. GitHub detects license.
7171

72-
2. [ ] **Scaffold TypeScript action**
72+
2. [x] **Scaffold TypeScript action**
7373
Tools: `npm`, `tsc`, template `actions/typescript-action`.
7474
Files: `package.json`, `tsconfig.json`, `action.yml`, `src/index.ts`.
7575
Verify: `npm run build` succeeds. `node dist/index.js` prints placeholder.

package-lock.json

Lines changed: 119 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "python-version-patch-pr",
3+
"version": "0.1.0",
4+
"description": "This repository hosts a GitHub Action that watches for new CPython patch releases and prepares pull requests to upgrade repositories that pin exact Python patch versions. The action is currently under active development.",
5+
"private": true,
6+
"main": "dist/index.js",
7+
"directories": {
8+
"doc": "docs"
9+
},
10+
"scripts": {
11+
"build": "tsc --project tsconfig.json",
12+
"clean": "rm -rf dist",
13+
"pretest": "npm run build",
14+
"test": "node dist/index.js"
15+
},
16+
"repository": {
17+
"type": "git",
18+
"url": "git+https://github.com/CasperKristiansson/python-version-patch-pr.git"
19+
},
20+
"keywords": [],
21+
"author": "",
22+
"license": "MIT",
23+
"files": [
24+
"dist"
25+
],
26+
"engines": {
27+
"node": ">=20"
28+
},
29+
"type": "commonjs",
30+
"bugs": {
31+
"url": "https://github.com/CasperKristiansson/python-version-patch-pr/issues"
32+
},
33+
"homepage": "https://github.com/CasperKristiansson/python-version-patch-pr#readme",
34+
"dependencies": {
35+
"@actions/core": "^1.10.1"
36+
},
37+
"devDependencies": {
38+
"@types/node": "^20.12.7",
39+
"typescript": "^5.4.5"
40+
}
41+
}

src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as core from '@actions/core';
2+
3+
async function run(): Promise<void> {
4+
try {
5+
const track = core.getInput('track') || '3.13';
6+
core.info(`CPython Patch PR Action placeholder executing for track ${track}.`);
7+
// Temporary placeholder output until task-specific logic is implemented.
8+
console.log('Placeholder: CPython patch PR action is under construction.');
9+
} catch (error) {
10+
if (error instanceof Error) {
11+
core.setFailed(error.message);
12+
} else {
13+
core.setFailed('Unknown error');
14+
}
15+
}
16+
}
17+
18+
void run();

tsconfig.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"module": "CommonJS",
5+
"moduleResolution": "Node",
6+
"outDir": "dist",
7+
"rootDir": "src",
8+
"strict": true,
9+
"esModuleInterop": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"resolveJsonModule": true,
12+
"skipLibCheck": true,
13+
"sourceMap": false,
14+
"inlineSources": false
15+
},
16+
"include": ["src/**/*"],
17+
"exclude": ["node_modules", "dist"]
18+
}

0 commit comments

Comments
 (0)