---
name: Check promotion diffs
on:
pull_request:
branches: [next, testing, stable]
permissions:
contents: read
jobs:
promotion-diff:
name: Check promotion diffs
runs-on: ubuntu-latest
if: "contains(github.event.pull_request.title, 'tree: promote changes from')"
steps:
- name: Get base commit hash
env:
COMMIT_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "ORIGIN_COMMIT=$(echo ${COMMIT_TITLE} | awk '{print $NF}')" >> $GITHUB_ENV
- name: Check out origin commit
uses: actions/checkout@v3
with:
path: origin
ref: ${{ env.ORIGIN_COMMIT }}
- name: Check out base branch
uses: actions/checkout@v3
with:
path: base
ref: ${{ github.base_ref }}
- name: Check out PR
uses: actions/checkout@v3
with:
path: new
- name: Ignore manifest files
run: |
cp base/manifest.yaml origin/
- name: Normalize kola-denylist.yaml
run: |
sed -E -i 's/^(\s+)((snooze:|warn:)\s+.*)/\1# \2 (disabled on promotion)/' origin/kola-denylist.yaml
- name: Normalize build-args.conf
run: |
for arg in DESCRIPTION STREAM COMPONENT; do
sed -i "/^${arg}=/d" origin/build-args.conf new/build-args.conf
done
- name: Compare trees
uses: coreos/actions-lib/check-diff@main
with:
basedir: origin
patchdir: new