From 1e088a99c482ea79abb5fc65ae468b4de7023ecb Mon Sep 17 00:00:00 2001 From: Emterry Date: Thu, 29 Feb 2024 16:28:32 +0000 Subject: [PATCH] add changelog --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ CHANGELOG.md | 0 2 files changed, 23 insertions(+) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b69174..caffb3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,3 +28,26 @@ jobs: with: context: . push: false + + preflight-checks: + name: Preflight Checks + runs-on: ubuntu-latest + steps: + - name: Checkout + id: checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Check CHANGELOG Updates + id: check_changelog_updates + env: + GH_TOKEN: ${{ github.token }} + run: | + mainSha=$(gh api --method GET /repos/"${GITHUB_REPOSITORY}"/contents/CHANGELOG.md --field ref="main" | jq -r '.sha') + branchSha=$(gh api --method GET /repos/"${GITHUB_REPOSITORY}"/contents/CHANGELOG.md --field ref="${GITHUB_HEAD_REF}" | jq -r '.sha') + + if [[ "${mainSha}" == "${branchSha}" ]]; then + echo "CHANGELOG.md matches main branch, needs to be updated" + exit 1 + elif [[ "${mainSha}" != "${branchSha}" ]]; then + echo "CHANGELOG.md does not match main branch, does not need to be updated" + fi \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29