Skip to content

pr-copy-ci-sudden-death #1576

pr-copy-ci-sudden-death

pr-copy-ci-sudden-death #1576

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:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
path: sudden-death
ref: ${{ github.sha }}
token: ${{secrets.CREATE_WORKFLOW_CI_TOKEN}}
- name: Set org name
uses: actions/[email protected]
id: set_org_name
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: return process.env.GITHUB_REPOSITORY.split('/')[0]
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
repository: ${{steps.set_org_name.outputs.result}}/hato-bot
path: hato-bot
- 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/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const script = require(`${process.env.GITHUB_WORKSPACE}/sudden-death/scripts/pr_copy_ci_sudden_death/pr_copy_ci/copy_package.js`)
script()
- uses: dev-hato/[email protected]
with:
github-token: ${{secrets.GITHUB_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