Skip to content

Commit 4efc74d

Browse files
committed
Use core.getInput rather than env vars
1 parent e2b9147 commit 4efc74d

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

‎actions/auto-merge-prs/action.yml‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,13 @@ runs:
2424
steps:
2525
- name: Check and merge eligible PRs
2626
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
27-
env:
28-
LABEL_NAME: ${{ inputs.label-name }}
29-
HOURS_OPEN: ${{ inputs.hours-open }}
30-
MERGE_METHOD: ${{ inputs.merge-method }}
3127
with:
3228
github-token: ${{ inputs.github-token }}
3329
script: |
3430
const { owner, repo } = context.repo;
35-
const labelName = process.env.LABEL_NAME;
36-
const hoursOpen = parseFloat(process.env.HOURS_OPEN);
37-
const mergeMethod = process.env.MERGE_METHOD;
38-
39-
core.info(`Checking PRs for ${owner}/${repo}`);
40-
core.info(`Required label: "${labelName}"`);
41-
core.info(`Required hours open: ${hoursOpen}`);
42-
core.info(`Merge method: ${mergeMethod}`);
31+
const labelName = core.getInput('label-name');
32+
const hoursOpen = parseFloat(core.getInput('hours-open'));
33+
const mergeMethod = core.getInput('merge-method');
4334
4435
// Get all open PRs (with pagination)
4536
const pullRequests = await github.paginate(github.rest.pulls.list, {
@@ -48,8 +39,7 @@ runs:
4839
state: 'open',
4940
per_page: 100
5041
});
51-
52-
core.info(`Found ${pullRequests.length} open PRs`);
42+
core.info(`Found ${pullRequests.length} open PRs for ${owner}/${repo}`);
5343
5444
// Process each PR
5545
for (const pr of pullRequests) {

0 commit comments

Comments
 (0)