Feat/solidity 0.8.26 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Gas Report | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
generate-gas-report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install dependencies | |
run: yarn install | |
- name: Generate gas report | |
run: yarn run gas-report | |
- name: Commit and push gas report | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add gas_report.md | |
git commit -m "Update gas report" || echo "No changes to gas report" | |
git push origin HEAD:${{ github.event.pull_request.head.ref }} | |
- name: Post gas report comment | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gas_report=$(cat gas_report.md) | |
curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST \ | |
-d "{\"body\":\"## Gas Report\n\n${gas_report}\"}" \ | |
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" |