-
Notifications
You must be signed in to change notification settings - Fork 117
48 lines (44 loc) · 1.67 KB
/
push-fossa-update-attribution-file.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Push ~ FOSSA update attribution file
on:
push:
branches:
- master
- release
paths:
- 'common/config/rush/pnpm-lock.yaml'
jobs:
prepare-branch-name:
runs-on: [ubuntu-latest]
outputs:
branch: ${{ steps.extract-branch.outputs.branch }}
steps:
- name: Extract branch name
id: extract-branch
env:
CURRENT_REF: ${{ github.event.ref }}
shell: bash
run: |
echo "branch=${CURRENT_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo $branch
run-fossa-scan-update-attribution:
needs: [prepare-branch-name]
name: Run FOSSA scan and update attribution file
uses: ./.github/workflows/rw-fossa-update-attribution-file.yml
secrets: inherit
permissions:
contents: write
id-token: write
with:
source-branch: ${{ needs.prepare-branch-name.outputs.branch }}
notify-publish-failed-to-slack:
if: ${{ always() && needs.run-fossa-scan-update-attribution.result == 'failure' }}
needs: [run-fossa-scan-update-attribution]
runs-on: [ubuntu-latest]
steps:
- name: Inform to slack when fossa workflows failed
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: "#javascript-notifications"
slack-message: ":warning: The FOSSA scan and attribution file creation failed. Check the *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|log here>* for further information."
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}