Repository navigation
Commit 2bd1170
authored
Fix failure of new matcher (#180)
See https://github.com/firebase/firebase-functions-dart/actions/runs/25219434625/job/73947703292?pr=160
## Summary of Investigation & Fix
The issue occurred because the action was attempting to register the problem matcher using `path.join(actionPath, 'dart-analyzer.json')`. When executed in a workflow, `actionPath` relied entirely on the `GITHUB_ACTION_PATH` environment variable. Under certain execution contexts (such as the `firebase-functions-dart` workflow), this environment variable was resolving to an empty string or was completely missing.
Consequently, the lookup path for `dart-analyzer.json` incorrectly defaulted to the *consumer repository's workspace* (`/home/runner/work/firebase-functions-dart/firebase-functions-dart/dart-analyzer.json`) where the file did not exist, ultimately breaking the build.
### Changes Made:
- **Exposed Repository Root**: Modified [lib/main.mjs](file:///Users/kevmoo/github/setup-dart/lib/main.mjs) to resolve the absolute repository location using `import.meta.url` and injected this path as `globalThis.actionRepoRoot`.
- **Updated Problem Matcher**: Modified [lib/main.dart](file:///Users/kevmoo/github/setup-dart/lib/main.dart) to access `actionRepoRoot` as a reliable fallback whenever `GITHUB_ACTION_PATH` is null or empty.
- **Built & Tested**: Verified with successful execution of `npm run all` and `dart test`.
The action now reliably discovers its internal files like `dart-analyzer.json` regardless of external environment variables!1 parent 23b5a66 commit 2bd1170
5 files changed
Lines changed: 41 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
144 | 151 | | |
145 | 152 | | |
146 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
0 commit comments