Allow disabling problem matchers (#85)

e6ab310 · Paulo F. Oliveira · 2022-01-12 11:41

6 files +27 -10

Files changed

modified README.md
+6 −2
@@ -16,7 +16,9 @@ workflow by:
16 16 - optionally, installing Gleam
17 17 - optionally, installing `rebar3`
18 18 - optionally, installing `hex`
19 - Configures [problem matchers](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) to show warnings and errors on PR's
19 +- optionally, having
20 + [problem matchers](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) show
21 + warnings and errors on pull requests
20 22
21 23 **Note** Currently, this action only supports Actions' `ubuntu-` and `windows-` runtimes.
22 24
@@ -170,7 +172,9 @@ jobs:
170 172
171 173 ## Elixir Problem Matchers
172 174
173 The Elixir Problem Matchers in this repository are adapted from [here](https://github.com/fr1zle/vscode-elixir/blob/45eddb589acd7ac98e0c7305d1c2b24668ca709a/package.json#L70-L118). See [MATCHER_NOTICE](MATCHER_NOTICE.md) for license details.
175 +The Elixir Problem Matchers in this repository are adapted from
176 +[here](https://github.com/fr1zle/vscode-elixir/blob/45eddb589acd7ac98e0c7305d1c2b24668ca709a/package.json#L70-L118).
177 +See [MATCHER_NOTICE](MATCHER_NOTICE.md) for license details.
174 178
175 179 ## Action versioning
176 180
modified action.yml
+3 −0
@@ -26,6 +26,9 @@ inputs:
26 26 description: strict means the versions are take as-are; loose means we try
27 27 to guess versions based on semver rules
28 28 default: loose
29 + disable_problem_matchers:
30 + description: whether to have the problem matchers present in the results (or not)
31 + default: false
29 32 outputs:
30 33 elixir-version:
31 34 description: Exact version of Elixir that was installed
modified dist/index.js
+9 −4
@@ -4738,10 +4738,15 @@ async function maybeInstallElixir(elixirSpec, otpVersion) {
4738 4738 console.log(`##[group]Installing Elixir ${elixirVersion}`)
4739 4739 await installer.installElixir(elixirVersion)
4740 4740 core.setOutput('elixir-version', elixirVersion)
4741 const matchersPath = __nccwpck_require__.ab + ".github"
4742 console.log(
4743 `##[add-matcher]${path.join(matchersPath, 'elixir-matchers.json')}`,
4744 )
4741 + const disableProblemMatchers = core.getInput('disable_problem_matchers', {
4742 + required: false,
4743 + })
4744 + if (!disableProblemMatchers) {
4745 + const matchersPath = __nccwpck_require__.ab + ".github"
4746 + console.log(
4747 + `##[add-matcher]${path.join(matchersPath, 'elixir-matchers.json')}`,
4748 + )
4749 + }
4745 4750 core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/elixir/bin`)
4746 4751 console.log('##[endgroup]')
4747 4752
modified src/setup-beam.js
+9 −4
@@ -66,10 +66,15 @@ async function maybeInstallElixir(elixirSpec, otpVersion) {
66 66 console.log(`##[group]Installing Elixir ${elixirVersion}`)
67 67 await installer.installElixir(elixirVersion)
68 68 core.setOutput('elixir-version', elixirVersion)
69 const matchersPath = path.join(__dirname, '..', '.github')
70 console.log(
71 `##[add-matcher]${path.join(matchersPath, 'elixir-matchers.json')}`,
72 )
69 + const disableProblemMatchers = core.getInput('disable_problem_matchers', {
70 + required: false,
71 + })
72 + if (!disableProblemMatchers) {
73 + const matchersPath = path.join(__dirname, '..', '.github')
74 + console.log(
75 + `##[add-matcher]${path.join(matchersPath, 'elixir-matchers.json')}`,
76 + )
77 + }
73 78 core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/elixir/bin`)
74 79 console.log('##[endgroup]')
75 80

Parents: 3250a83