Skip to content

chore: switch to pyproject #1

chore: switch to pyproject

chore: switch to pyproject #1

Workflow file for this run

name: Pull Request
on:
pull_request:
types: [opened, synchronize]
branches: [main]
jobs:
build:
uses: ./.github/workflows/reusable-build.yml
with:
bump-command: "local-bump"
comment:
needs: build
runs-on: ubuntu-latest
steps:
- name: Comment PR
uses: actions/github-script@v6
with:
script: |
const version = '${{ needs.build.outputs.package-version }}'
const comment = `
🚀 Build artifacts are ready for testing!
### Installation
**Local release:**
\`\`\`bash
pip install safety-${version}-py3-none-any.whl
\`\`\`
**Binary:**
Download the appropriate binary for your platform from the artifacts section.
`
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
})
}