chore: switch to pyproject #6
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: Pull Request | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
branches: [main] | |
jobs: | |
build: | |
uses: ./.github/workflows/reusable-build.yml | |
with: | |
bump-command: "local-bump" | |
branch-name: ${{ github.head_ref }} | |
comment: | |
needs: build | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Comment PR | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const version = '${{ needs.build.outputs.package-version }}' | |
const artifactsUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/` | |
const comment = ` | |
## 🚀 Build artifacts are ready for testing! | |
Download the wheel file and binaries from the [workflow artifacts](${artifactsUrl}). | |
### Installation | |
**Local release:** | |
\`\`\`bash | |
pip install safety-${version}-py3-none-any.whl | |
\`\`\` | |
> Note: You need to be logged in to GitHub to access the artifacts. | |
` | |
const { data: comments } = await github.rest.issues.listComments({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
}) | |
const botComment = comments.find(comment => | |
comment.user.type === 'Bot' && | |
comment.body.includes('Build artifacts are ready for testing!') | |
) | |
if (botComment) { | |
await github.rest.issues.updateComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
comment_id: botComment.id, | |
body: comment | |
}) | |
} else { | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
body: comment | |
}) | |
} |