Skip to content

Commit fdc5310

Browse files
committed
Switch to github-script
1 parent 1e262c3 commit fdc5310

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@ inputs:
1919
outputs:
2020
result:
2121
description: 'JSON array of parsed changelog entries'
22+
value: ${{ steps.changelog-extractor.outputs.result }}
23+
24+
# runs:
25+
# using: 'node24'
26+
# main: 'src/index.js'
2227

2328
runs:
24-
using: 'node24'
25-
main: 'src/index.js'
29+
using: 'composite'
30+
steps:
31+
- name: Get WordPress Versions
32+
id: changelog-extractor
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
const run = require('${{github.action_path}}/src/index.js');
37+
await run(core);

src/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
const core = require('@actions/core');
21
const fs = require('fs');
32
const path = require('path');
43
const { parseChangelog } = require('./parser');
54

65
/**
76
* Main action entry point
87
*/
9-
async function run() {
8+
async function run(core) {
109
try {
1110
// Get inputs
1211
const changelogPath = core.getInput('changelog-path') || 'CHANGELOG.md';
@@ -42,9 +41,4 @@ async function run() {
4241
}
4342
}
4443

45-
// Only run if this is the main module
46-
if (require.main === module) {
47-
run();
48-
}
49-
5044
module.exports = { run };

0 commit comments

Comments
 (0)