forked from stanfordnlp/dspy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request stanfordnlp#565 from stanfordnlp/add-pr-comment-ruff
ci(dspy): Fix failing tests coming from forks
- Loading branch information
Showing
5 changed files
with
293 additions
and
160 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Comment for PR | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Check for Ruff Fix, Test, and Build"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Download Ruff Fix Outcome Artifact" | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ruff-fix-outcome | ||
path: artifacts | ||
|
||
- name: "Read Ruff Fix Outcome" | ||
id: ruff_outcome | ||
run: | | ||
outcome=$(cat artifacts/ruff_fix_outcome.txt) | ||
echo "RUFF_FIX_OUTCOME=$outcome" >> $GITHUB_ENV | ||
- name: "Comment on PR if Ruff Fix Failed" | ||
if: env.RUFF_FIX_OUTCOME == 'true' | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
const pr_number = ${{ github.event.workflow_run.pull_requests[0].number }}; | ||
const message = 'It seems like there are issues with the formatting. Please run `ruff check . --fix-only` and commit to address these issues.'; | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: pr_number, | ||
body: message | ||
}); |
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
Oops, something went wrong.