Skip to content

Commit de758c1

Browse files
authored
CIのスクリプトをまとめる (#452)
* CIのスクリプトをまとめる * Add export * Fix export
1 parent ac0bd46 commit de758c1

6 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/renovate-config-validator.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ jobs:
1616
- uses: actions/setup-node@v3.5.1
1717
with:
1818
cache: npm
19-
- run: npm ci
20-
- run: npx renovate-config-validator
19+
- run: bash "${GITHUB_WORKSPACE}/scripts/renovate_config_validator/renovate_config_validator/validate.sh"
2120

2221
concurrency:
2322
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}

.github/workflows/update-readme.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
with:
2828
cache: npm
2929
- run: npm ci
30-
- run: echo "DESCRIPTION=$(yq '.description' action.yml)" >> "${GITHUB_ENV}"
3130
- name: Get inputs markdown
3231
id: get_inputs_markdown
3332
uses: actions/github-script@v6.3.3
@@ -40,9 +39,8 @@ jobs:
4039
const script = require('./scripts/update_readme/update_readme/get_inputs_markdown.js')
4140
return script()
4241
- env:
43-
DESCRIPTION: ${{env.DESCRIPTION}}
4442
INPUTS: ${{steps.get_inputs_markdown.outputs.result}}
45-
run: envsubst < README.template.md > README.md
43+
run: bash "${GITHUB_WORKSPACE}/scripts/update_readme/update_readme/update_readme.sh"
4644
- uses: ./
4745
with:
4846
github-token: ${{secrets.GITHUB_TOKEN}}

action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ inputs:
2727
runs:
2828
using: "composite"
2929
steps:
30-
- shell: bash
31-
if: github.event_name != 'pull_request' || github.event.action != 'closed'
32-
name: git add
33-
run: git add -A
3430
# 差分があったときは差分を出力する
3531
- name: Show diff
3632
id: diff

scripts/action/show_diff.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
git add -A
4+
35
result=$(git diff --cached)
46
result="${result//'%'/'%25'}"
57
result="${result//$'\n'/'%0A'}"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
npm ci
4+
npx renovate-config-validator
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
DESCRIPTION="$(yq '.description' action.yml)"
4+
export DESCRIPTION
5+
envsubst < README.template.md > README.md

0 commit comments

Comments
 (0)