Skip to content

Commit 5484ca0

Browse files
authored
chore: up to date linting and codeowners and misc (#29)
## Describe your changes * Updated logging to include failure message even in the raw output * Updated linting / testing action ## Reminder: - When the PR is ready, be sure to run `npm run build` to compile into the distribution `/dist` folder, which is the source code that the Action uses.
1 parent 9eecaf7 commit 5484ca0

File tree

7 files changed

+27
-19
lines changed

7 files changed

+27
-19
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Use this file to define individuals or teams that are responsible for code in a repository.
2+
# Read more: <https://help.github.com/articles/about-codeowners/>
3+
#
4+
# Order is important: the last matching pattern takes the most precedence
5+
6+
# These owners will be the default owners for everything
7+
* @masterpointio/masterpoint-open-source
8+
* @oycyc

.github/workflows/lint.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
1-
name: Lint (Trunk.io)
2-
3-
on: pull_request
1+
name: Lint
42

53
concurrency:
6-
group: ${{ github.head_ref || github.run_id }}
4+
group: lint-${{ github.head_ref || github.run_id }}
75
cancel-in-progress: true
86

7+
on: pull_request
8+
99
permissions:
10+
actions: read
11+
checks: write
1012
contents: read
13+
pull-requests: read
1114

1215
jobs:
13-
trunk:
16+
lint:
1417
runs-on: ubuntu-latest
15-
permissions:
16-
contents: read
17-
checks: write
1818
steps:
19-
- uses: actions/checkout@v4
20-
- uses: trunk-io/trunk-action@v1
19+
- name: Check out Git repository
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
- name: Trunk Check
22+
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
2123

22-
conventional-commit-title-check:
24+
conventional-title:
2325
runs-on: ubuntu-latest
24-
permissions:
25-
pull-requests: read
2626
steps:
27-
- uses: amannn/action-semantic-pull-request@v5
27+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
with:
31-
requireScope: true

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
pr_comment_title: Below is the Action testing on itself with this PR's source code against policies in `/examples` file by file. Confirm it is as expected.
4444

4545
- name: Test Local Action (Directory Package Mode)
46+
if: (success() || failure())
4647
id: test-action-opa-package
4748
uses: ./
4849
with:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ It's super easy to get started and use this GitHub Action to test your OPA Rego
3232
uses: masterpointio/github-action-opa-rego-test@main
3333
with:
3434
path: ./examples
35+
test_mode: directory # Whether to test the Rego by directory (e.g. opa test ./) or by individual files (e.g. opa test a_test.rego a.rego). Options of `directory` or `file`.
3536
report_untested_files: true # Flag to check & report Rego files that does NOT have corresponding test files. Optional, defaults to false.
3637
```
3738

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26343,7 +26343,7 @@ function main() {
2634326343
const testsFailed = parsedResults.some((result) => result.status === "FAIL");
2634426344
core.setOutput("tests_failed", testsFailed.toString());
2634526345
if (testsFailed) {
26346-
core.setFailed("One or more OPA tests failed");
26346+
core.setFailed(`One or more OPA tests failed: ${opaError}`);
2634726347
}
2634826348
}
2634926349
catch (error) {

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export async function main() {
9393
core.setOutput("tests_failed", testsFailed.toString());
9494

9595
if (testsFailed) {
96-
core.setFailed("One or more OPA tests failed");
96+
core.setFailed(`One or more OPA tests failed: ${opaError}`);
9797
}
9898
} catch (error) {
9999
if (error instanceof Error) {

0 commit comments

Comments
 (0)