Skip to content

Commit

Permalink
comment when action failed
Browse files Browse the repository at this point in the history
  • Loading branch information
adu-web3 committed Jun 3, 2024
1 parent 85cb117 commit 541b379
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
# replace nightly because latest nightly release has some breaking changes that result in test failures
# this is a previous recent nightly release that should work
version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9
version: stable

- name: Run Forge build
run: |
Expand All @@ -41,3 +39,16 @@ jobs:
run: |
forge test -vvv
id: test

- name: Add comment on failure
if: failure()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'The GitHub Actions workflow has failed. Please check the logs for more details.'
})

0 comments on commit 541b379

Please sign in to comment.