From e30b46e156365a6aea1dc0f80207cd71ef46befd Mon Sep 17 00:00:00 2001 From: atsuyaw Date: Tue, 22 Oct 2024 22:02:36 +0900 Subject: [PATCH] perf: Open PR only when create --- .github/workflows/gh-pages.yml | 10 ++++------ .github/workflows/lint.yml | 8 +++----- .github/workflows/release.yml | 14 +++++--------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 90ca1be7..67b8fad7 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,4 +1,4 @@ -name: Deploy GitHub Pages +name: Build GitHub Pages "on": [push, workflow_dispatch] @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true # Fetch Hugo themes (true OR recursive) + submodules: false # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Setup Go @@ -26,11 +26,9 @@ jobs: hugo-version: '0.135.0' extended: true - - name: Build hugo site - run: hugo --minify + - run: hugo --minify - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + - uses: peaceiris/actions-gh-pages@v3 if: github.ref == 'refs/heads/main' with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3f858416..13ca546f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,11 +2,8 @@ name: Lint "on": push: - branches: ["Notting"] - # branches-ignore: - # - main - # tags: - # - "*" + branches-ignore: + - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -18,6 +15,7 @@ jobs: permissions: contents: write pull-requests: write + if: ${{ github.ref }} == 'refs/heads/main' steps: - uses: actions/checkout@v4 - name: Run markdownlint-cli2-action@v17 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69542d4e..9a5f59c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,12 @@ name: Release -"on": - push: - branches-ignore: - - main - tags: - - "*" +"on": ["create"] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + GH_TOKEN: ${{ github.token }} jobs: openPR: @@ -17,11 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 - name: Create PR - env: - GH_TOKEN: ${{ github.token }} run: | gh pr create \ --base "main" \ --head "${{ github.ref_name }}" \ --title "Release/${{ github.ref_name }}" \ - --body "GitHub actions" \ + --body "" \ + --draft