FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bifrost/.github/workflows/dependabot-alerts.yml at dev · stackblitz/bifrost · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
stackblitz
/
bifrost
Public
forked from
maximhq/bifrost
Notifications
You must be signed in to change notification settings
Fork
0
Star
3
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
bifrost
/
.github
/
workflows
/
dependabot-alerts.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
61 lines (51 loc) · 1.91 KB
Breadcrumbs
bifrost
/
.github
/
workflows
/
dependabot-alerts.yml
Copy path
File metadata and controls
61 lines (51 loc) · 1.91 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
49
50
51
52
53
54
55
56
57
58
59
60
61
name
:
Dependabot Alerts to Issues
on
:
schedule
:
-
cron
:
"
0 9 * * 1
"
#
Weekly on Monday at 9am UTC
workflow_dispatch
:
permissions
:
issues
:
write
jobs
:
create-issues
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Harden Runner
uses
:
step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594
#
v2.16.0
with
:
egress-policy
:
block
allowed-endpoints
:
>
api.github.com:443
-
name
:
Create issues from Dependabot alerts
env
:
GH_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
run
:
|
alerts=$(gh api repos/${{ github.repository }}/dependabot/alerts \
--jq '[.[] | select(.state == "open")]')
echo "$alerts" | jq -c '.[]' | while read -r alert; do
pkg=$(echo "$alert" | jq -r '.dependency.package.name')
number=$(echo "$alert" | jq -r '.number')
severity=$(echo "$alert" | jq -r '.security_advisory.severity')
summary=$(echo "$alert" | jq -r '.security_advisory.summary')
url=$(echo "$alert" | jq -r '.html_url')
ecosystem=$(echo "$alert" | jq -r '.dependency.package.ecosystem')
# Skip if issue already exists for this alert
existing=$(gh issue list \
--repo "${{ github.repository }}" \
--search "Dependabot Alert #${number}" \
--json number --jq 'length')
if [ "$existing" = "0" ]; then
gh issue create \
--repo "${{ github.repository }}" \
--title "dep: update ${pkg} (${severity})" \
--label "dependencies" \
--body "$(cat <<EOF
## Dependabot Alert #${number}
**Package:** \`${pkg}\`
**Ecosystem:** ${ecosystem}
**Severity:** ${severity}
${summary}
[View Alert](${url})
EOF
)"
fi
done
Back
|
FazBrowse Home
|
New Git URL