Skip to content

Commit a5b7784

Browse files
committed
Adds test gh action + adds some logging to transforms
1 parent 79ce848 commit a5b7784

4 files changed

Lines changed: 47 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linting
30+
run: npm run lint
31+
32+
- name: Run tests
33+
run: npm run test

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ inputs:
88
description: "The ID of the deployment to run"
99
type: string
1010
required: true
11+
deploymentKey:
12+
description: "The deployment secret key which authorizes the action to run the deployment"
13+
type: string
14+
required: true
1115
outputs:
1216
pullRequestNumbers:
13-
description: "The pull request number that was created or updated (comma separated)"
17+
description: "The pull request number(s) created or updated (comma separated)"
1418
branding:
1519
icon: "star"
1620
color: "black"

dist/index.js

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/main.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,14 @@ export default async function main() {
137137

138138
// Handle transforms
139139
if (isTransformEntry(entry)) {
140-
const transformEntry = entry.transform.sources.find(
141-
({ name }) => name === "transform.ts" || name === "transform.js"
142-
);
140+
console.log(entry.transform.sources);
141+
142+
const transformEntry = entry.transform.sources.find(({ name }) => {
143+
console.log(name, name === "transform.ts" || name === "transform.js");
144+
return name === "transform.ts" || name === "transform.js";
145+
});
146+
147+
console.log(transformEntry);
143148

144149
if (!transformEntry) {
145150
core.warning(

0 commit comments

Comments
 (0)