Skip to content

Commit

Permalink
chores: test ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
cosinlink committed Sep 8, 2024
1 parent 7e1fa4f commit 0c5637a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/check-bsc-hardfork-bytecode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@ jobs:
npm install ts-node -g
npm install
# - name: Extract BSC commitId and hardfork name from PR description
# uses: actions/github-script@v6
# with:
# script: |
# const prBody = context.payload.pull_request.body || '';
# console.log("PR description:", prBody);
# return { prBody };

- name: Extract PR description
run: echo "PR_BODY=${{ github.event.pull_request.body }}" >> $GITHUB_ENV
- name: Extract BSC commitId and hardfork name from PR description
id: extract_pr_description
uses: actions/github-script@v6
with:
script: |
const prBody = context.payload.pull_request.body || '';
console.log("PR description:", prBody);
const p1 = prBody.indexOf('>CI')
const p2 = prBody.indexOf('>CI', p1 + 1)
const info = prBody.substring(p1 + 3, p2)
console.log(p1, p2, info)
return { prBody, info };
- name: Compare genesis with hardfork bytecode files from BSC repo
run: |
export HARDFORK_NAME=${{ steps.extract_pr_description.outputs.info }}
export PR_BODY=${{ steps.extract_pr_description.outputs.prBody }}
ts-node scripts/check-bsc-hardfork-bytecode.ts
2 changes: 2 additions & 0 deletions scripts/check-bsc-hardfork-bytecode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ const clear0x = (str: string) => {
const main = async () => {
const pr = process.env.PR_BODY
log('PR_BODY:', pr)
const info = process.env.info
log('info:', info)
const p1 = pr.indexOf('>CI')
const p2 = pr.indexOf('>CI', p1 + 1)
log(p1, p2, pr.substring(p1 + 3, p2))
Expand Down

0 comments on commit 0c5637a

Please sign in to comment.