From c867ba6bc8c1007c6bb7be62d931308e9b9efcdc Mon Sep 17 00:00:00 2001 From: ginokent <29125616+ginokent@users.noreply.github.com> Date: Tue, 14 May 2024 17:12:40 +0900 Subject: [PATCH] ci: Fix paths-ignore conditions for lint and test --- .github/workflows/go-lint-skip.yml | 52 ++++++++++++++++++++++++++++++ .github/workflows/go-test-skip.yml | 52 ++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 .github/workflows/go-lint-skip.yml create mode 100644 .github/workflows/go-test-skip.yml diff --git a/.github/workflows/go-lint-skip.yml b/.github/workflows/go-lint-skip.yml new file mode 100644 index 0000000..0fccc9e --- /dev/null +++ b/.github/workflows/go-lint-skip.yml @@ -0,0 +1,52 @@ +name: go-lint +# ^^^^^^^ +# https://github.com/organization/repository/workflows/go-lint/badge.svg +# ^^^^^^^ + +on: + push: + branches: + - main + paths: + - '.github/dependabot.yml' + - '.github/pull_request_template.md' + - '.github/release.yml' + - '.github/workflows/label-checker.yml' + - '.github/workflows/task-list-checker.yml' + - '**.md' + pull_request: + paths: + - '.github/dependabot.yml' + - '.github/pull_request_template.md' + - '.github/release.yml' + - '.github/workflows/label-checker.yml' + - '.github/workflows/task-list-checker.yml' + - '**.md' + workflow_dispatch: + inputs: {} + +# NOTE: If commit & push continuously, cancel the workflow other than the latest commit. +concurrency: + group: ${{ github.workflow }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + id-token: write + contents: read + +env: + WORKDIR: . + +defaults: + run: + shell: bash + +jobs: + go-lint: # NOTE: for Branch protection rule `Status checks that are required.` + name: Run golangci-lint + runs-on: ubuntu-latest # ref. https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + steps: + - name: Not required # ref. https://stackoverflow.com/questions/70927785/skip-required-check-if-its-not-applicable-in-github-actions + shell: bash + run: | + echo "Not required" diff --git a/.github/workflows/go-test-skip.yml b/.github/workflows/go-test-skip.yml new file mode 100644 index 0000000..17a64d0 --- /dev/null +++ b/.github/workflows/go-test-skip.yml @@ -0,0 +1,52 @@ +name: go-test +# ^^^^^^^ +# https://github.com/organization/repository/workflows/go-test/badge.svg +# ^^^^^^^ + +on: + push: + branches: + - main + paths: + - '.github/dependabot.yml' + - '.github/pull_request_template.md' + - '.github/release.yml' + - '.github/workflows/label-checker.yml' + - '.github/workflows/task-list-checker.yml' + - '**.md' + pull_request: + paths: + - '.github/dependabot.yml' + - '.github/pull_request_template.md' + - '.github/release.yml' + - '.github/workflows/label-checker.yml' + - '.github/workflows/task-list-checker.yml' + - '**.md' + workflow_dispatch: + inputs: {} + +# NOTE: If commit & push continuously, cancel the workflow other than the latest commit. +concurrency: + group: ${{ github.workflow }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + id-token: write + contents: read + +env: + WORKDIR: . + +defaults: + run: + shell: bash + +jobs: + go-test: # NOTE: for Branch protection rule `Status checks that are required.` + name: Run go test + runs-on: ubuntu-latest # ref. https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + steps: + - name: Not required # ref. https://stackoverflow.com/questions/70927785/skip-required-check-if-its-not-applicable-in-github-actions + shell: bash + run: | + echo "Not required"