Skip to content

first test at passing image for the image build template #5

first test at passing image for the image build template

first test at passing image for the image build template #5

Workflow file for this run

---
name: Build
on:
pull_request:
branches:
- main
permissions: {}
jobs:
build:
name: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: test
run: |
python -m unittest discover -s test -p '*_test.py'
- name: Build Docker image
uses: docker/build-push-action@74166686865cdc289a02f214871fb53447b73447 # v5.1.0
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