Skip to content

Commit

Permalink
ci: typoのチェック
Browse files Browse the repository at this point in the history
  • Loading branch information
yamadashy committed Oct 11, 2024
1 parent 297cca1 commit f44e075
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 389 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

jobs:
lint-biome:
name: Lint Biome
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
Expand All @@ -25,6 +26,7 @@ jobs:
- run: yarn lint-biome && git diff --exit-code

lint-ts:
name: Lint TypeScript
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
Expand All @@ -37,6 +39,7 @@ jobs:
- run: yarn lint-ts

lint-secretlint:
name: Lint Secretlint
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
Expand All @@ -49,6 +52,7 @@ jobs:
- run: yarn lint-secretlint

validate-renovate-config:
name: Validate Renovate config
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
Expand All @@ -60,6 +64,7 @@ jobs:
run: npx --yes --package renovate -- renovate-config-validator --strict

test:
name: Test
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
Expand All @@ -72,6 +77,7 @@ jobs:
- run: yarn test-coverage

generate:
name: Generate feed and site
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
Expand All @@ -90,3 +96,10 @@ jobs:
with:
name: feed-generate-results
path: public/feeds

check-typo:
name: Check for typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected]
4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[files]
extend-exclude = [
"src/resources/feed-info-list.ts"
]
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"@types/http-server": "^0.12.1",
"@types/node": "^20.10.4",
"@types/open-graph-scraper": "^4.8.1",
"@types/request": "^2.48.8",
"@vitest/coverage-v8": "^2.0.3",
"async-retry": "^1.3.3",
"await-to-js": "^3.0.0",
Expand All @@ -59,7 +58,6 @@
"log4js": "^6.9.1",
"open-graph-scraper": "^6.5.1",
"renovate": "^37.253.1",
"request": "^2.88.2",
"rss-parser": "^3.12.0",
"secretlint": "^8.3.0",
"sharp-ico": "^0.1.5",
Expand Down
28 changes: 13 additions & 15 deletions src/feed/register-index-command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { google } from 'googleapis';
import * as request from 'request';
import constants from '../common/constants';
import { sleep } from './utils/common-util';
import type { BlogFeed } from './utils/feed-storer';
Expand Down Expand Up @@ -45,30 +44,29 @@ jwtClient.authorize(async (err, tokens) => {
}

for (const indexTargetUrl of indexTargetUrls) {
const options: request.CoreOptions = {
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${tokens.access_token || ''}`,
},
auth: { bearer: tokens.access_token || '' },
json: {
body: JSON.stringify({
url: indexTargetUrl,
type: 'URL_UPDATED',
},
}),
};

await request.post(GOOGLE_INDEXING_API_END_POINT, options, async (error, response, body) => {
if (error) {
console.error(error);
return;
}
if (response.statusCode !== 200) {
console.error(response.statusCode, body);
return;
try {
const response = await fetch(GOOGLE_INDEXING_API_END_POINT, options);
if (!response.ok) {
console.error(response.status, await response.text());
continue;
}

const body = await response.json();
console.log(`[index api] success! url: ${body.urlNotificationMetadata.url}`);
});
} catch (error) {
console.error(error);
}

await sleep(1000);
}
Expand Down
2 changes: 1 addition & 1 deletion src/resources/feed-info-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export const FEED_INFO_LIST: FeedInfo[] = createFeedInfoList([
['SmartHR', 'https://tech.smarthr.jp/feed'],
['SmartNews', 'https://developer.smartnews.com/blog/feed'],
['SmartNewsメディア担当チーム', 'https://www.mediatechnology.jp/feed'],
['Snowlfake', 'https://zenn.dev/p/dataheroes/feed'],
['Snowflake', 'https://zenn.dev/p/dataheroes/feed'],
['Social Databank', 'https://zenn.dev/p/sdb_blog/feed'],
['Speee', 'https://tech.speee.jp/feed'],
['Spiral.AI', 'https://zenn.dev/p/spiralai/feed'],
Expand Down
Loading

0 comments on commit f44e075

Please sign in to comment.