Skip to content

Commit

Permalink
chore(ci): automate detection of last auto-rename commit(ethereum#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 authored Jan 13, 2025
1 parent d08d0f0 commit e2b0abb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/libevm-delta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,36 @@ on:

jobs:
diffs:
env:
# Last commit from rename-module workflow job to be included in `main`
LIBEVM_BASE: 0b56af5a01b8a0c6fc9d60247bb79ffd03d1bcfd
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # everything
fetch-tags: true

- name: Find base commit hash
id: base-commit
run: echo "LIBEVM_BASE=$(git rev-list --author "github-actions\[bot\]" --grep "rename Go module" -n 1 origin/main)" >> "$GITHUB_OUTPUT"

- name: Color-blindness a11y
run:
| # https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40:~:text=8%20pairs%20of%20contrasting%20colors
git config color.diff.old "#DC3220";
git config color.diff.new "#005AB5";

- name: git diff {LIBEVM_BASE}
- name: git diff ${{ steps.base-commit.outputs.LIBEVM_BASE }}
run: |
git diff --diff-filter=a --word-diff --unified=0 --color=always \
"${LIBEVM_BASE}" \
${{ steps.base-commit.outputs.LIBEVM_BASE }} \
':(exclude).golangci.yml' \
':(exclude).github/**' \
':(exclude)README.md';
- name: git diff {LIBEVM_BASE}..main
- name: git diff ${{ steps.base-commit.outputs.LIBEVM_BASE }}..main
run: |
git checkout main --;
git diff --diff-filter=a --word-diff --unified=0 --color=always \
"${LIBEVM_BASE}" \
"${{ steps.base-commit.outputs.LIBEVM_BASE }}" \
':(exclude).golangci.yml' \
':(exclude).github/**' \
':(exclude)README.md';
1 change: 1 addition & 0 deletions .github/workflows/rename-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
# WARNING: mirror any change to the commit_message value below in libevm-delta.yml
commit_message: "[AUTO] rename Go module + update internal import paths\n\nWorkflow: ${{ steps.vars.outputs.WORKFLOW_HASH }} on branch ${{ github.ref_name }}"
repo: ${{ github.repository }}
branch: ${{ steps.vars.outputs.DEST_BRANCH }}

0 comments on commit e2b0abb

Please sign in to comment.