Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIで使用しているスクリプトをTypeScript化する #4575

Merged
merged 4 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,23 @@ jobs:
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
SHA: ${{github.event.pull_request.head.sha}}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/release/create_pr_environment/create_pr_environment.js`)
await script({github, context})
const {tsImport} = require('tsx/esm/api')
const {script} = await tsImport(
'./scripts/release/create_pr_environment/create_pr_environment.ts',
process.env.GITHUB_WORKSPACE + '/'
)
await script(github, context)
lighthouse:
runs-on: ubuntu-latest
needs: deploy-app-engine
Expand Down Expand Up @@ -536,6 +545,11 @@ jobs:
contents: read
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- name: Get run numbers
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: get_run_numbers
Expand All @@ -546,8 +560,9 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/get_run_numbers.js`)
return await script({github, context, core})
const {tsImport} = require('tsx/esm/api')
const {script} = await tsImport( './scripts/get_run_numbers.ts', process.env.GITHUB_WORKSPACE + '/')
return await script(github, context)
- id: "auth"
if: ${{ steps.get_run_numbers.outputs.result != '' }}
name: "Authenticate to GCP"
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/remove_app_engine_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
if: github.repository == github.event.pull_request.head.repo.full_name && github.repository == 'dev-hato/hato-atama'
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- name: Get run numbers
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: get_run_numbers
Expand All @@ -22,8 +27,9 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/get_run_numbers.js`)
return await script({github, context, core})
const {tsImport} = require('tsx/esm/api')
const {script} = await tsImport( './scripts/get_run_numbers.ts', process.env.GITHUB_WORKSPACE + '/')
return await script(github, context)
- id: "auth"
if: ${{ steps.get_run_numbers.outputs.result != '' }}
name: "Authenticate to GCP"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
ESLINT_USE_FLAT_CONFIG: false
JAVASCRIPT_DEFAULT_STYLE: prettier
VALIDATE_JAVASCRIPT_STANDARD: false
TYPESCRIPT_DEFAULT_STYLE: prettier
VALIDATE_TYPESCRIPT_STANDARD: false
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
Loading
Loading