|
34 | 34 | - name: 'Run bandit security scan' |
35 | 35 | run: docker compose run --rm bandit |
36 | 36 |
|
| 37 | + - name: Compute added/removed lines for notification |
| 38 | + if: ${{ github.event_name == 'pull_request' }} |
| 39 | + id: diff |
| 40 | + run: | |
| 41 | + PR_DATA=$(gh pr view "${{ github.event.pull_request.number }}" --json additions,deletions -q '.') |
| 42 | + ADDITIONS=$(echo "$PR_DATA" | jq '.additions') |
| 43 | + DELETIONS=$(echo "$PR_DATA" | jq '.deletions') |
| 44 | + echo "additions=$ADDITIONS" >> $GITHUB_OUTPUT |
| 45 | + echo "deletions=$DELETIONS" >> $GITHUB_OUTPUT |
| 46 | + env: |
| 47 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + - name: Notify Microsoft Teams |
| 49 | + if: ${{ github.event_name == 'pull_request' }} |
| 50 | + uses: softwareone-platform/notify-pr-teams-action@v4 |
| 51 | + with: |
| 52 | + webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }} |
| 53 | + bot_image_url: https://raw.githubusercontent.com/softwareone-platform/ffc-finops-api-modifier/main/.github/workflows/assets/turing_team_pr_bot.png |
| 54 | + repo: ${{ github.repository }} |
| 55 | + pr_url: ${{ github.event.pull_request.html_url }} |
| 56 | + pr_title: ${{ github.event.pull_request.title }} |
| 57 | + pr_author: ${{ github.event.pull_request.user.login }} |
| 58 | + head_ref: ${{ github.event.pull_request.head.ref }} |
| 59 | + base_ref: ${{ github.event.pull_request.base.ref }} |
| 60 | + commits: ${{ github.event.pull_request.commits }} |
| 61 | + changed_files: ${{ github.event.pull_request.changed_files }} |
| 62 | + additions: ${{ steps.diff.outputs.additions }} |
| 63 | + deletions: ${{ steps.diff.outputs.deletions }} |
| 64 | + pr_number: ${{ github.event.pull_request.number }} |
| 65 | + pr_status: ${{ github.event.pull_request.state }} |
| 66 | + is_merged: ${{ github.event.pull_request.merged }} |
| 67 | + |
37 | 68 | - name: SonarQube Scan |
38 | 69 | uses: sonarsource/sonarqube-scan-action@v4 |
39 | 70 | env: |
|
0 commit comments