forked from koluku/sudden-death
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (58 loc) · 2.34 KB
/
pr-copy-ci-sudden-death.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: pr-copy-ci-sudden-death
on:
workflow_dispatch:
push:
branches:
- master
jobs:
# hato-botのCIの差分がpushされたらPRを作成する
pr-copy-ci:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
path: sudden-death
ref: ${{ github.sha }}
token: ${{steps.generate_token.outputs.token}}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
repository: ${{ github.repository_owner }}/hato-bot
path: hato-bot
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: npm
cache-dependency-path: sudden-death/package-lock.json
node-version-file: sudden-death/package.json
- run: bash "${GITHUB_WORKSPACE}/sudden-death/scripts/pr_copy_ci_sudden_death/pr_copy_ci/npm_ci.sh"
working-directory: sudden-death
- name: Copy CI
run: bash "${GITHUB_WORKSPACE}/sudden-death/scripts/pr_copy_ci_sudden_death/pr_copy_ci/copy_ci.sh"
- name: Copy package.json
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const {tsImport} = require('tsx/esm/api')
const {script} = await tsImport(
'./scripts/pr_copy_ci_sudden_death/pr_copy_ci/copy_package.ts',
process.env.GITHUB_WORKSPACE + '/sudden-death/'
)
script()
- uses: dev-hato/actions-diff-pr-management@8d475e5bc78f61c40024d4859b79134b66f788d2 # v1.2.1
with:
github-token: ${{steps.generate_token.outputs.token}}
branch-name-prefix: pr-copy-ci
pr-title-prefix: hato-botのCIを反映するよ!
working-directory: sudden-death
exit-failure: "false"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true