Post Gas Report Comment #194
This file contains hidden or 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: Post Gas Report Comment | |
| on: | |
| workflow_run: | |
| workflows: ["Gas Report"] | |
| types: | |
| - completed | |
| permissions: | |
| actions: read | |
| pull-requests: write | |
| issues: write | |
| contents: read | |
| jobs: | |
| comment: | |
| name: Post Gas Report Comment | |
| runs-on: ubuntu-latest | |
| # Only run if the workflow run was for a pull request | |
| if: github.event.workflow_run.event == 'pull_request' | |
| steps: | |
| - name: Check workflow run status | |
| run: | | |
| echo "Workflow run conclusion: ${{ github.event.workflow_run.conclusion }}" | |
| echo "Workflow run event: ${{ github.event.workflow_run.event }}" | |
| echo "Workflow run ID: ${{ github.event.workflow_run.id }}" | |
| echo "Head branch: ${{ github.event.workflow_run.head_branch }}" | |
| - name: Checkout repository | |
| if: github.event.workflow_run.conclusion == 'success' | |
| uses: actions/checkout@v4 | |
| - name: Download and post gas report comment | |
| if: github.event.workflow_run.conclusion == 'success' | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const script = require('./.github/scripts/post-gas-comment.js'); | |
| await script({ github, context }); |