Skip to content

Commit 0af75aa

Browse files
committed
renderdiff: enable update goldens on commit merge
RDIFF_BRANCH=pf/renderdiff-brach-comp-update
1 parent 4f4d92d commit 0af75aa

File tree

9 files changed

+401
-190
lines changed

9 files changed

+401
-190
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'Get commit message'
2+
outputs:
3+
msg:
4+
value: ${{ steps.action_output.outputs.msg }}
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Find commit message (on push)
9+
if: github.event_name == 'push'
10+
shell: bash
11+
run: |
12+
echo "${{ github.event.head_commit.message }}" >> /tmp/commit_msg.txt
13+
- name: Checkout code
14+
shell: bash
15+
id: checkout_code
16+
if: github.event_name == 'pull_request'
17+
run: |
18+
echo "hash=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
19+
git checkout ${{ github.event.pull_request.head.ref }}
20+
COMMIT_MESSAGE=$(git log -1)
21+
echo "${COMMIT_MESSAGE}" >> /tmp/commit_msg.txt
22+
- shell: bash
23+
id: action_output
24+
run: |
25+
DELIMITER="EOF_FILE_CONTENT_$(date +%s)" # Using timestamp to make it more unique
26+
echo "msg<<$DELIMITER" >> "$GITHUB_OUTPUT"
27+
cat /tmp/commit_msg.txt >> "$GITHUB_OUTPUT"
28+
echo "$DELIMITER" >> "$GITHUB_OUTPUT"
29+
- name: Uncheckout code
30+
shell: bash
31+
if: github.event_name == 'pull_request'
32+
run: |
33+
git checkout ${{ steps.checkout.outputs.hash }}

.github/workflows/postsubmit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# name: 'Post-submit tasks'
2+
3+
# on:
4+
# pull_request:
5+
# branches:
6+
# - main
7+
# push:
8+
# branches:
9+
# - main
10+
11+
# jobs:
12+
# update-renderdiff-goldens:
13+
# name: update-renderdiff-goldens
14+
# runs-on: 'ubuntu-24.04-4core'
15+
# steps:
16+
# - uses: actions/[email protected]
17+
# with:
18+
# fetch-depth: 0
19+
# - uses: ./.github/actions/linux-prereq
20+
# - id: get_commit_msg
21+
# uses: ./.github/actions/get-commit-msg
22+
# - name: Run update script
23+
# run: |
24+
# GOLDEN_BRANCH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | python3 test/renderdiff/src/commit_msg.py)
25+
# COMMIT_HASH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | head -n 1 | tr -d 'commit ')
26+
# if [[ "${GOLDEN_BRANCH}" != "main" ]]; then
27+
# python3 test/renderdiff/src/update_golden.py --branch=${GOLDEN_BRANCH} \
28+
# --merge-to-main --filament-tag=${COMMIT_HASH}
29+
# cd filament-assets
30+
# git checkout ${GOLDEN_BRANCH}
31+
# git log -1
32+
# fi

0 commit comments

Comments
 (0)