Skip to content

Add ERC: ESG Tokenization Protocol #12821

Add ERC: ESG Tokenization Protocol

Add ERC: ESG Tokenization Protocol #12821

Workflow file for this run

name: Continuous Integration
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- edited
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
save-pr:
name: Save PR Number
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
MERGE_SHA: ${{ github.sha }}
run: |
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
echo $PR_SHA > ./pr/pr_sha
echo $MERGE_SHA > ./pr/merge_sha
- name: Upload PR Number
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: pr_number
path: pr/
htmlproofer:
name: HTMLProofer
runs-on: ubuntu-24.04
steps:
- name: Checkout EIPs
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: ethereum/EIPs
path: ''
fetch-depth: 0
- name: Restore EIPs mtimes from git history
uses: chetan/git-restore-mtime-action@d186aca54f8760da4dec55313195e51ed3ebb0b3 # v2.3
- name: Get EIPs Version
id: eips
run: echo "sha=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT
- name: Checkout ERCs
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: ethereum/ERCs
path: ERCs
fetch-depth: 0
- name: Restore ERCs mtimes from git history
uses: chetan/git-restore-mtime-action@d186aca54f8760da4dec55313195e51ed3ebb0b3 # v2.3
with:
working-directory: ERCs
- name: Get Changed Files
id: changed
continue-on-error: true
run: |
ALL_CHANGED=$(gh pr diff ${{ github.event.number }} --name-only --repo ${{ github.repository }})
# Only pure ERC markdown changes are safe for the incremental path.
# Asset changes can otherwise leave stale files in `_site/`.
NON_ERC=$(echo "$ALL_CHANGED" | grep -v -E '^ERCS/erc-[0-9]+\.md$' | grep -v '^\s*$' || true)
if [ -n "$NON_ERC" ]; then
echo "Non-ERC files changed, will run full check"
echo "mode=full" >> $GITHUB_OUTPUT
exit 0
fi
CHANGED_NUMS=$(echo "$ALL_CHANGED" | grep -oE 'erc-[0-9]+' | sed 's/erc-//' | sort -u | tr '\n' ' ')
if [ -z "$CHANGED_NUMS" ]; then
echo "mode=full" >> $GITHUB_OUTPUT
else
echo "mode=incremental" >> $GITHUB_OUTPUT
echo "nums=${CHANGED_NUMS}" >> $GITHUB_OUTPUT
echo "Will check only changed ERCs: ${CHANGED_NUMS}"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge Repos
run: |
mkdir -p $GITHUB_WORKSPACE/ERCs/ERCS
mkdir -p $GITHUB_WORKSPACE/ERCs/EIPS
cp -rp $GITHUB_WORKSPACE/ERCs/ERCS/. $GITHUB_WORKSPACE/EIPS
cp -rp $GITHUB_WORKSPACE/ERCs/EIPS/. $GITHUB_WORKSPACE/EIPS
cp -rp $GITHUB_WORKSPACE/ERCs/assets/. $GITHUB_WORKSPACE/assets
cp -rp $GITHUB_WORKSPACE/ERCs/_layouts/. $GITHUB_WORKSPACE/_layouts 2>/dev/null || true
cd $GITHUB_WORKSPACE/EIPS
find . -name "erc-*.md" -type f -exec sh -c 'echo mv "$1" "$(echo "$1" | sed s/erc/eip/)"' _ {} \; | sh
cd $GITHUB_WORKSPACE/assets
find . -name "erc-*" -type d -exec sh -c 'echo mv "$1" "$(echo "$1" | sed s/erc/eip/)"' _ {} \; | sh
cd $GITHUB_WORKSPACE
rm -rf ERCs
- name: Setup Ruby
uses: ruby/setup-ruby@fb404b9557c186e349162b0d8efb06e2bc36edea # v1.232.0
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: 0
- name: Restore Jekyll Cache
id: cache
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
_site
.jekyll-metadata
# PR reruns can reuse their own cache via the current PR merge ref.
# If that misses, GitHub falls back to caches visible from the base/default branch.
key: jekyll-${{ runner.os }}-eips-${{ steps.eips.outputs.sha }}
restore-keys: |
jekyll-${{ runner.os }}-
# See .github/workflows/README.md for how incremental builds and caching work.
# Always use --incremental: it creates .jekyll-metadata for future runs,
# and falls back to a full build when .jekyll-metadata is missing.
- name: Build Website
run: |
bundle exec jekyll doctor
echo "::notice::Jekyll incremental build (mode=${{ steps.changed.outputs.mode }})"
bundle exec jekyll build --incremental
- name: HTML Proofer
run: |
if [ "${{ steps.changed.outputs.mode }}" = "incremental" ]; then
PATHS=()
for num in ${{ steps.changed.outputs.nums }}; do
slug="eip-${num}"
if [ -d "./_site/EIPS/${slug}" ]; then
PATHS+=("./_site/EIPS/${slug}")
elif [ -f "./_site/EIPS/${slug}.html" ]; then
PATHS+=("./_site/EIPS/${slug}.html")
elif [ -d "./_site/${slug}" ]; then
PATHS+=("./_site/${slug}")
elif [ -f "./_site/${slug}.html" ]; then
PATHS+=("./_site/${slug}.html")
fi
done
if [ ${#PATHS[@]} -gt 0 ]; then
printf -v PATHS_NOTICE ' %q' "${PATHS[@]}"
echo "::notice::Running HTMLProofer on changed files only:${PATHS_NOTICE}"
bundle exec htmlproofer --root-dir ./_site --allow-missing-href --disable-external --assume-extension '.html' --log-level=:info --cache='{"timeframe":{"external":"6w"}}' --checks 'Links,Images,Scripts,OpenGraph' --no-check-sri --ignore-empty-alt --no-enforce_https "${PATHS[@]}"
exit $?
fi
echo "::warning::Changed ERC HTML files not found in build output, falling back to full check"
fi
bundle exec htmlproofer --allow-missing-href --disable-external --assume-extension '.html' --log-level=:info --cache='{"timeframe":{"external":"6w"}}' --checks 'Links,Images,Scripts,OpenGraph' --no-check-sri --ignore-empty-alt --no-enforce_https ./_site
- name: DNS Validator
run: bundle exec github-pages health-check
- name: Save Jekyll Cache
if: always()
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
_site
.jekyll-metadata
key: jekyll-${{ runner.os }}-eips-${{ steps.eips.outputs.sha }}
link-check:
name: Link Check
runs-on: ubuntu-latest
steps:
- name: Checkout EIP Repository
uses: actions/checkout@47fbe2df0ad0e27efb67a70beac3555f192b062f
- name: Link Checker
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec
with:
config-file: config/mlc_config.json
use-quiet-mode: no
use-verbose-mode: yes
check-modified-files-only: yes
codespell:
name: CodeSpell
runs-on: ubuntu-latest
steps:
- name: Checkout EIP Repository
uses: actions/checkout@47fbe2df0ad0e27efb67a70beac3555f192b062f
- name: Get Changed Files
id: changed
continue-on-error: true
run: |
echo "CHANGED_FILES<<EOF" >> $GITHUB_ENV
gh pr diff ${{ github.event.number }} --name-only | sed -e 's|$|,|' | xargs -i echo "{}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run CodeSpell
uses: codespell-project/actions-codespell@57beb9f38f49d773d641ac555d1565c3b6a59938
if: steps.changed.outcome == 'success'
with:
check_filenames: true
ignore_words_file: config/.codespell-whitelist
path: ${{ env.CHANGED_FILES }}
skip: .git,Gemfile.lock,**/*.png,**/*.gif,**/*.jpg,**/*.svg,.codespell-whitelist,vendor,_site,_config.yml,style.css
eipw-validator:
name: EIP Walidator
runs-on: ubuntu-latest
steps:
- name: Checkout EIP Repository
uses: actions/checkout@47fbe2df0ad0e27efb67a70beac3555f192b062f
- uses: ethereum/eipw-action@be3fa642ec311d0b8e1fdb811e5c9b4ada3d3d93
id: eipw
with:
token: ${{ secrets.GITHUB_TOKEN }}
unchecked: 1
path: ERCS/
options-file: config/eipw.toml
markdownlint:
name: Markdown Linter
runs-on: ubuntu-latest
steps:
- name: Checkout EIP Repository
uses: actions/checkout@47fbe2df0ad0e27efb67a70beac3555f192b062f
- name: Get Changed Files
id: changed
continue-on-error: true
run: |
echo "CHANGED_FILES<<EOF" >> $GITHUB_ENV
gh pr diff ${{ github.event.number }} --name-only | grep -E -x '[^/]+\.md|EIPS/eip-[0-9]+\.md' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Lint
uses: DavidAnson/markdownlint-cli2-action@f5cf187ef11bd3a68a127321b794aa252ff23019
if: steps.changed.outcome == 'success'
with:
command: config
globs: |
config/.markdownlint.yaml
${{ env.CHANGED_FILES }}