Roll out next 39.20230916.1.2 #96
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Check stream diffs | |
on: | |
pull_request: | |
branches: [main] | |
paths: ["streams/*.json"] | |
permissions: | |
contents: read | |
jobs: | |
stream-diff: | |
name: Check stream diffs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Genericize metadata | |
run: | | |
# Cache data from PR head | |
mkdir head | |
cp -r streams ci/genericize-stream.py head | |
# Switch to base | |
git checkout "${GITHUB_BASE_REF}" | |
# Get the numerically latest fedora-coreos-stream-generator tag | |
generator_tag=$( | |
curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/coreos/fedora-coreos-stream-generator/git/matching-refs/tags/ | | |
jq -r .[].ref | | |
sed s:^refs/tags/:: | | |
sort -V | | |
tail -n 1) | |
echo "Current fedora-coreos-stream-generator: ${generator_tag}" | |
# Genericize metadata | |
mkdir -p {old,new}/streams | |
for stream in streams/*.json; do | |
if cmp -s "${stream}" "head/${stream}"; then | |
# Base and head identical; ignore stream to avoid false | |
# positives if the generator field is stale | |
echo "${stream} unchanged, skipping" | |
continue | |
fi | |
echo "${stream}, old" | |
# Pretend the old metadata used the latest tag of | |
# fedora-coreos-stream-generator. | |
head/genericize-stream.py -g "${generator_tag}" "${stream}" > "old/${stream}" | |
echo "${stream}, new" | |
head/genericize-stream.py "head/${stream}" > "new/${stream}" | |
done | |
- name: Compare genericized metadata | |
uses: coreos/actions-lib/check-diff@main | |
with: | |
basedir: old | |
patchdir: new |