Skip to content

Commit e2b0abb

Browse files
authored
chore(ci): automate detection of last auto-rename commit(#99)
1 parent d08d0f0 commit e2b0abb

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/libevm-delta.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,36 @@ on:
99

1010
jobs:
1111
diffs:
12-
env:
13-
# Last commit from rename-module workflow job to be included in `main`
14-
LIBEVM_BASE: 0b56af5a01b8a0c6fc9d60247bb79ffd03d1bcfd
1512
runs-on: ubuntu-latest
1613
steps:
1714
- uses: actions/checkout@v4
1815
with:
1916
fetch-depth: 0 # everything
2017
fetch-tags: true
2118

19+
- name: Find base commit hash
20+
id: base-commit
21+
run: echo "LIBEVM_BASE=$(git rev-list --author "github-actions\[bot\]" --grep "rename Go module" -n 1 origin/main)" >> "$GITHUB_OUTPUT"
22+
2223
- name: Color-blindness a11y
2324
run:
2425
| # https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40:~:text=8%20pairs%20of%20contrasting%20colors
2526
git config color.diff.old "#DC3220";
2627
git config color.diff.new "#005AB5";
2728

28-
- name: git diff {LIBEVM_BASE}
29+
- name: git diff ${{ steps.base-commit.outputs.LIBEVM_BASE }}
2930
run: |
3031
git diff --diff-filter=a --word-diff --unified=0 --color=always \
31-
"${LIBEVM_BASE}" \
32+
${{ steps.base-commit.outputs.LIBEVM_BASE }} \
3233
':(exclude).golangci.yml' \
3334
':(exclude).github/**' \
3435
':(exclude)README.md';
3536
36-
- name: git diff {LIBEVM_BASE}..main
37+
- name: git diff ${{ steps.base-commit.outputs.LIBEVM_BASE }}..main
3738
run: |
3839
git checkout main --;
3940
git diff --diff-filter=a --word-diff --unified=0 --color=always \
40-
"${LIBEVM_BASE}" \
41+
"${{ steps.base-commit.outputs.LIBEVM_BASE }}" \
4142
':(exclude).golangci.yml' \
4243
':(exclude).github/**' \
4344
':(exclude)README.md';

.github/workflows/rename-module.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
env:
7272
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
7373
with:
74+
# WARNING: mirror any change to the commit_message value below in libevm-delta.yml
7475
commit_message: "[AUTO] rename Go module + update internal import paths\n\nWorkflow: ${{ steps.vars.outputs.WORKFLOW_HASH }} on branch ${{ github.ref_name }}"
7576
repo: ${{ github.repository }}
7677
branch: ${{ steps.vars.outputs.DEST_BRANCH }}

0 commit comments

Comments
 (0)