From 60dc57c1be43cffd012e78c2b9ddd604eb25ad67 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sun, 30 Apr 2023 14:47:19 +0900 Subject: [PATCH] =?UTF-8?q?CI:=20PR=20close=E6=99=82=E3=81=AE=E3=82=B9?= =?UTF-8?q?=E3=82=AD=E3=83=83=E3=83=97=E5=87=A6=E7=90=86=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/format-json-yml.yml | 1 + .github/workflows/update-gitleaks.yml | 5 ++++- .github/workflows/update-package.yml | 5 ++++- .github/workflows/update-readme.yml | 9 +++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/format-json-yml.yml b/.github/workflows/format-json-yml.yml index af76c3bd..9ebe1897 100644 --- a/.github/workflows/format-json-yml.yml +++ b/.github/workflows/format-json-yml.yml @@ -21,6 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.5.2 + if: github.event_name != 'pull_request' || github.event.action != 'closed' with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/update-gitleaks.yml b/.github/workflows/update-gitleaks.yml index 89c99025..5e143237 100644 --- a/.github/workflows/update-gitleaks.yml +++ b/.github/workflows/update-gitleaks.yml @@ -21,15 +21,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.5.2 + if: github.event_name != 'pull_request' || github.event.action != 'closed' with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - uses: actions/setup-node@v3.6.0 + if: github.event_name != 'pull_request' || github.event.action != 'closed' with: cache: npm - name: Install packages + if: github.event_name != 'pull_request' || github.event.action != 'closed' run: npm ci - - uses: dev-hato/actions-update-gitleaks@v0.0.43 + - uses: dev-hato/actions-update-gitleaks@v0.0.44 with: github-token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/update-package.yml b/.github/workflows/update-package.yml index 1399d64a..d342f8d2 100644 --- a/.github/workflows/update-package.yml +++ b/.github/workflows/update-package.yml @@ -21,13 +21,16 @@ jobs: pull-requests: write steps: - uses: actions/checkout@v3.5.2 + if: github.event_name != 'pull_request' || github.event.action != 'closed' with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - uses: actions/setup-node@v3.6.0 + if: github.event_name != 'pull_request' || github.event.action != 'closed' with: cache: npm - - run: npm install + - if: github.event_name != 'pull_request' || github.event.action != 'closed' + run: npm install - uses: dev-hato/actions-diff-pr-management@v1.1.3 with: github-token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index 50a94781..3f5e2fd4 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -20,15 +20,19 @@ jobs: pull-requests: write steps: - uses: actions/checkout@v3.5.2 + 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@v3.6.0 + if: github.event_name != 'pull_request' || github.event.action != 'closed' with: cache: npm - - run: npm ci + - 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@v6.4.1 env: HEAD_REF: ${{github.event.pull_request.head.ref || github.head_ref}} @@ -38,7 +42,8 @@ jobs: script: | const script = require('./scripts/update_readme/update_readme/get_inputs_markdown.js') return script() - - env: + - 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" - uses: dev-hato/actions-diff-pr-management@v1.1.3