Skip to content

Commit c3171c4

Browse files
committed
feat: ci cmd
1 parent 3fa1c35 commit c3171c4

File tree

22 files changed

+246
-670
lines changed

22 files changed

+246
-670
lines changed

.changeset/odd-pets-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": minor
3+
---
4+
5+
add `ci` cmd

.github/workflows/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
paths:
7-
- action/**
7+
- Dockerfile
88
branches:
99
- main
1010

@@ -28,6 +28,6 @@ jobs:
2828
with:
2929
push: true
3030
platforms: linux/amd64
31-
context: ./action
32-
file: ./action/Dockerfile
31+
context: ./
32+
file: ./Dockerfile
3333
tags: ${{ secrets.DOCKERHUB_LINGODOTDEV_USERNAME }}/ci-action:latest

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:20.12.2-alpine
2+
3+
# Run the Node.js / TypeScript application
4+
ENTRYPOINT ["sh", "-c", "npx lingo.dev@latest ci \
5+
--api-key \"$LINGODOTDEV_API_KEY\" \
6+
--pull-request \"$LINGODOTDEV_PULL_REQUEST\" \
7+
--commit-message \"$LINGODOTDEV_COMMIT_MESSAGE\" \
8+
--pull-request-title \"$LINGODOTDEV_PULL_REQUEST_TITLE\" \
9+
--working-directory \"$LINGODOTDEV_WORKING_DIRECTORY\" \
10+
--process-own-commits \"$LINGODOTDEV_PROCESS_OWN_COMMITS\""]

action.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ branding:
99
runs:
1010
using: "composite"
1111
steps:
12-
- name: Install pnpm
13-
run: cd ${{ github.action_path }} && npm install -g pnpm && pnpm install
14-
shell: bash
15-
- name: Build
16-
run: cd ${{ github.action_path }}/action && pnpm build
17-
shell: bash
1812
- name: Run
19-
run: node ${{ github.action_path }}/action/build/index.js
13+
run: |
14+
npx lingo.dev@latest ci \
15+
--api-key ${{ inputs.api-key }} \
16+
--pull-request ${{ inputs.pull-request }} \
17+
--commit-message ${{ inputs.commit-message }} \
18+
--pull-request-title ${{ inputs.pull-request-title }} \
19+
--working-directory ${{ inputs.working-directory }} \
20+
--process-own-commits ${{ inputs.process-own-commits }}
2021
shell: bash
21-
env:
22-
LINGODOTDEV_API_KEY: ${{ inputs.api-key }}
23-
LINGODOTDEV_PULL_REQUEST: ${{ inputs.pull-request }}
24-
LINGODOTDEV_COMMIT_MESSAGE: ${{ inputs.commit-message }}
25-
LINGODOTDEV_PULL_REQUEST_TITLE: ${{ inputs.pull-request-title }}
26-
LINGODOTDEV_WORKING_DIRECTORY: ${{ inputs.working-directory }}
27-
LINGODOTDEV_PROCESS_OWN_COMMITS: ${{ inputs.process-own-commits }}
2822
inputs:
2923
api-key:
3024
description: "Lingo.dev Platform API Key"

action/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

action/Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

action/package.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)