Skip to content

Commit

Permalink
Bump FantasticFiasco/action-update-license-year from 2 to 3 (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Apr 8, 2023
1 parent 99d40bc commit 866b3c8
Show file tree
Hide file tree
Showing 13 changed files with 703 additions and 716 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Please check if your PR fulfills the following requirements:

- [ ] I have read the [CONTRIBUTING](https://github.com/fabasoad/translation-action/CONTRIBUTING.md)
- [ ] I have read the [CONTRIBUTING](https://github.com/fabasoad/translation-action/blob/main/CONTRIBUTING.md)
doc.
- [ ] Tests for the changes have been added (for bug fixes / features).
- [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features).
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- 'v*.*.*'

jobs:
create_release:
create-release:
name: Release
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
- provider: 'mymemory'
lang: 'en|it'
source: 'Love'
expected: 'AMORE'
expected: 'Amore'
api_key: 'N_A' # pragma: allowlist secret
- provider: 'mymemory'
lang: 'en|pt'
source: 'Love'
expected: 'Com gratidão,'
expected: 'Amor'
api_key: 'MYMEMORY_API_KEY' # pragma: allowlist secret
- provider: 'funtranslations'
lang: 'klingon'
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node_modules
id: cache
- name: Cache yarn dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: '**/node_modules'
path: |
.yarn/cache
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/.yarnrc.yml') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Compile
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
run: yarn install
shell: sh
- name: Lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@v2
- uses: FantasticFiasco/action-update-license-year@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
assignees: ${{ github.repository_owner }}
Expand Down
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ repos:
pass_filenames: false
verbose: true
stages: ["push"]
# Security
- id: audit
name: Yarn audit
entry: yarn npm audit --all
language: system
pass_filenames: false
verbose: false
stages: ["push"]
# Security
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
Expand Down Expand Up @@ -73,6 +73,5 @@ repos:
- id: no-commit-to-branch
- id: trailing-whitespace
ci:
autofix_prs: true
autoupdate_schedule: quarterly
autofix_prs: false
skip: [build, eslint, test, audit]
4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "translation-action",
"version": "2.1.0",
"version": "2.1.1",
"description": "This GitHub action translates any text from any language to any language.",
"main": "dist/index.js",
"scripts": {
Expand All @@ -26,24 +26,24 @@
"homepage": "https://github.com/fabasoad/translation-action#readme",
"dependencies": {
"@actions/core": "1.10.0",
"deepl-node": "1.8.0",
"google-translate-api-x": "10.5.4",
"deepl-node": "1.9.0",
"google-translate-api-x": "10.6.2",
"node-fetch": "2.6.9",
"typed-rest-client": "1.8.9"
},
"devDependencies": {
"@types/jest": "29.4.0",
"@typescript-eslint/eslint-plugin": "5.52.0",
"@typescript-eslint/parser": "5.52.0",
"@types/jest": "29.5.0",
"@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1",
"@vercel/ncc": "0.36.1",
"dotenv": "16.0.3",
"eslint": "8.34.0",
"eslint": "8.38.0",
"eslint-config-google": "0.14.0",
"jest": "29.4.2",
"jest-circus": "29.4.2",
"jest": "29.5.0",
"jest-circus": "29.5.0",
"mocha-param": "2.0.1",
"ts-jest": "29.0.5",
"typescript": "4.9.5"
"ts-jest": "29.1.0",
"typescript": "5.0.4"
},
"packageManager": "yarn@3.4.1"
}
2 changes: 1 addition & 1 deletion src/__tests__/providers/DeeplProvider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DeeplProvider from '../../providers/DeeplProvider'
import { config } from 'dotenv'
import ProviderTester from './ProviderTester';
import ProviderTester from './ProviderTester'

config()

Expand Down
21 changes: 1 addition & 20 deletions src/__tests__/providers/MyMemoryProvider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('MyMemoryProvider', () => {
fixture,
async ({ providerTester }: ProviderTesterWrapper) =>
providerTester.positive({
text: 'Evening', lang: 'en|pt', expected: 'NOITE'
text: 'Night', lang: 'en|be', expected: 'Ноч'
})
)

Expand All @@ -36,23 +36,4 @@ describe('MyMemoryProvider', () => {
async ({ providerTester }: ProviderTesterWrapper) =>
providerTester.negative()
)

// itParam<string | undefined>('should get correct translation',
// [undefined, process.env.MYMEMORY_API_KEY], async (apiKey) => {
// const provider: ProviderBase = new MyMemoryProvider(apiKey)
// const translations = await provider.translate('Evening', 'en|pt')
// expect(translations.length).toBeGreaterThan(0)
// expect(translations[0]).toEqual('NOITE')
// })
//
// test('should fail because of invalid lang', async () => {
// const provider: ProviderBase = new MyMemoryProvider()
// try {
// await provider.translate('Evening', 'abc123')
// } catch (e) {
// expect(e).toBeTruthy()
// return
// }
// fail()
// })
})
2 changes: 1 addition & 1 deletion src/__tests__/providers/ProviderTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class ProviderTester {
expected: 'Вірш'
}): Promise<void> {
try {
const translations = await this.provider.translate(text, lang)
const translations: string[] = await this.provider.translate(text, lang)
expect(translations.length).toBeGreaterThan(0)
expect(translations[0]).toEqual(expected)
} catch (e: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion src/providers/MyMemoryProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class MyMemoryProvider extends ProviderBase {
url += (this.apiKey ? `&key=${this.apiKey}` : '');
return this.api<MyMemoryResponse>({ url, method: 'GET' })
.then(({ matches }) => {
matches.sort((a, b) => a.match > b.match ? 1 : -1);
matches.sort((a, b) => a.match > b.match ? -1 : 1);
return matches.map(({ translation }) => translation);
});
}
Expand Down
Loading

0 comments on commit 866b3c8

Please sign in to comment.