github.com/ecodeclub/eorm@v0.0.2-0.20231001112437-dae71da914d0/.github/workflows/changelog.yml (about)

     1  # Copyright 2021 ecodeclub
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  # http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  name: changelog
    16  
    17  on:
    18    pull_request:
    19      types: [opened, synchronize, reopened, labeled, unlabeled]
    20      branches:
    21        - dev
    22        - main
    23  
    24  jobs:
    25    changelog:
    26      runs-on: ubuntu-latest
    27      if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')"
    28  
    29      steps:
    30        - uses: actions/checkout@v2
    31  
    32        - name: Check for CHANGELOG changes
    33          run: |
    34            # Only the latest commit of the feature branch is available
    35            # automatically. To diff with the base branch, we need to
    36            # fetch that too (and we only need its latest commit).
    37            git fetch origin ${{ github.base_ref }} --depth=1
    38            if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
    39            then
    40              echo "A CHANGELOG was modified. Looks good!"
    41            else
    42              echo "No CHANGELOG was modified."
    43              echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
    44              false
    45            fi