Skip to content

Commit ce280bb

Browse files
authored
Use env to read auto-merge inputs (#108)
1 parent 49a0c18 commit ce280bb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

actions/auto-merge-prs/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ runs:
2424
steps:
2525
- name: Check and merge eligible PRs
2626
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
27+
env:
28+
INPUT_LABEL_NAME: ${{ inputs.label-name }}
29+
INPUT_HOURS_OPEN: ${{ inputs.hours-open }}
30+
INPUT_MERGE_METHOD: ${{ inputs.merge-method }}
2731
with:
2832
github-token: ${{ inputs.github-token }}
2933
script: |
3034
const { owner, repo } = context.repo;
31-
const labelName = core.getInput('label-name');
32-
const hoursOpen = parseFloat(core.getInput('hours-open'));
33-
const mergeMethod = core.getInput('merge-method');
35+
const labelName = process.env.INPUT_LABEL_NAME;
36+
const hoursOpen = parseFloat(process.env.INPUT_HOURS_OPEN);
37+
const mergeMethod = process.env.INPUT_MERGE_METHOD;
3438
3539
// Get all open PRs (with pagination)
3640
const pullRequests = await github.paginate(github.rest.pulls.list, {
@@ -77,7 +81,7 @@ runs:
7781
core.info(`❌ PR opened ${hoursSinceCreation.toFixed(2)} hours ago (needs ${hoursOpen}+ hours)`);
7882
continue;
7983
}
80-
core.info(`✅ PR opened ${hoursSinceCreation.toFixed(2)} hours ago`);
84+
core.info(`✅ PR opened ${hoursSinceCreation.toFixed(2)} hours ago (over ${hoursOpen} hours)`);
8185
8286
// Check if the PR has a known valid merge commit SHA
8387
if (!pr.merge_commit_sha) {

0 commit comments

Comments
 (0)