Skip to content

Commit 9328215

Browse files
authored
trial: composite (#25)
* update action.yml to use composite * set inputs as env * use node-version-file to manage the node version easily * move if and checkout steps to action.yml * restore `uses:actions/checkout@v4` in test-action.yml ref: #25 (comment) * set if on each step
1 parent 3d10fb3 commit 9328215

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/workflows/test-action.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ jobs:
1717
runs-on: ubuntu-latest
1818
permissions:
1919
pull-requests: write
20-
if: github.event_name != 'issue_comment' || github.event.issue.pull_request
2120
steps:
22-
- name: Checkout
23-
id: checkout
24-
uses: actions/checkout@v4
25-
21+
- uses: actions/checkout@v4
2622
- name: Test Local Action
2723
id: test-action
2824
uses: ./

action.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,18 @@ inputs:
1818
required: false
1919

2020
runs:
21-
using: node20
22-
main: dist/index.js
21+
using: 'composite'
22+
steps:
23+
- uses: actions/checkout@v4
24+
if: github.event_name != 'issue_comment' || github.event.issue.pull_request
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version-file: '.node-version'
28+
if: github.event_name != 'issue_comment' || github.event.issue.pull_request
29+
- run: 'node ${GITHUB_ACTION_PATH}/dist/index.js'
30+
shell: bash
31+
env:
32+
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
33+
INPUT_THRESHOLD: ${{ inputs.threshold }}
34+
INPUT_DEBUG: ${{ inputs.debug }}
35+
if: github.event_name != 'issue_comment' || github.event.issue.pull_request

0 commit comments

Comments
 (0)