-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (57 loc) · 2.17 KB
/
update-readme.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
---
name: update-readme
on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
cache: npm
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: npm ci
- name: Get inputs markdown
id: get_inputs_markdown
if: github.event_name != 'pull_request' || github.event.action != 'closed'
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
HEAD_REF: ${{github.event.pull_request.head.ref || github.head_ref}}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const script = require('./scripts/update_readme/update_readme/get_inputs_markdown.js')
return script()
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
env:
INPUTS: ${{steps.get_inputs_markdown.outputs.result}}
run: bash "${GITHUB_WORKSPACE}/scripts/update_readme/update_readme/update_readme.sh"
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: npx prettier --write .
- uses: dev-hato/actions-diff-pr-management@e5c78b251a69f44f93b2f1398e06b129bcf151ec # v1.2.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
branch-name-prefix: fix-readme
pr-title-prefix: README修正
pr-description-prefix: READMEを修正しました。
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true