diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 604fbeb..52c6a99 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -7,18 +7,24 @@ jobs: plan: runs-on: ubuntu-latest steps: - - name: Git checkout - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16' + - run: yarn install + - run: yarn run build - - name: Pull Request Comment - uses: ./ - with: - json-file: | - test-data/tf_test.json - test-data/tf_test2.json - test-data/tf_test3.json + - name: Pull Request Comment + uses: ./ + with: + json-file: | + test-data/tf_test.json + test-data/tf_test2.json + test-data/tf_test3.json + + - name: Pull Request Comment + uses: ./ + with: + json-file: test-data/tf_test.json + expand-comment: 'true' - - name: Pull Request Comment - uses: ./ - with: - json-file: test-data/tf_test.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d31b418..36aa14f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,10 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16' - name: Install Dependencies run: yarn install diff --git a/action.yml b/action.yml index 978a29e..0e14679 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,10 @@ inputs: description: GitHub Token required: false default: '${{github.token}}' + expand-comment: + description: If true, expand the details comment by default + required: false + default: 'false' runs: using: node16 main: dist/index.js diff --git a/index.js b/index.js index 1ee90c1..5297ed3 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ const trackedChanges = { "update": "!" } +const expandDetailsComment = core.getBooleanInput('expand-comment'); const myToken = core.getInput('github-token'); const octokit = github.getOctokit(myToken); @@ -45,10 +46,12 @@ function fileComment(inputFile, showFileName) { changes.filter(obj => obj.change.actions[0] === "update").length + ' to change, ' + changes.filter(obj => obj.change.actions[0] === "delete").length + ' to destroy.' + let openDetails = expandDetailsComment ? "open" : "" + let output = showFileName ? `\`${inputFile}\`` : "" output += ` -
${summary} +
${summary} ${message}
diff --git a/package.json b/package.json index e50d3dd..110ccd4 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "type": "git", "url": "https://github.com/liatrio/terraform-change-pr-commenter.git" }, + "engines": { + "node": ">=16" + }, "release": { "branches": [ "main" @@ -41,8 +44,8 @@ ] }, "keywords": [], - "author": "", - "license": "ISC", + "author": "Liatrio", + "license": "Apache-2.0", "bugs": { "url": "https://github.com/liatrio/terraform-change-pr-commenter/issues" },