forked from dependency-check/DependencyCheck
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.75 KB
/
publish-suppressions.yml
File metadata and controls
48 lines (44 loc) · 1.75 KB
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
name: Publish Suppressions
on:
workflow_dispatch:
permissions: {}
jobs:
update_suppression:
permissions:
contents: write # to push changes in repo (jamesives/github-pages-deploy-action)
name: Publish Suppressions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: generatedSuppressions
- uses: actions/setup-node@v6.3.0
- run: |
npm install fs
- name: Create Generated Suppressions XML
uses: actions/github-script@v8.0.0
with:
script: |
const fs = require('fs');
const generatedSuppressions = fs.readFileSync('generatedSuppressions.xml', 'utf8');
if (!fs.existsSync('./suppressions')){
fs.mkdirSync('./suppressions');
}
fs.appendFileSync('suppressions/publishedSuppressions.xml',
`<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd
https://dependency-check.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
${generatedSuppressions}
</suppressions>`,
function (err) {
if (err) throw err;
console.log('publishedSuppressions.xml created');
});
- name: Publish Updated Suppressions
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
branch: gh-pages
folder: suppressions
target-folder: suppressions