From 535ce460df7a48145fbe4f23b6af559dd3c64c8d Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Fri, 20 Jan 2023 17:03:14 -0300 Subject: [PATCH] workflow: add update core/npm indexes --- .github/workflows/update-core-index.yml | 38 +++++++++++++++++++++++++ .github/workflows/update-npm-index.yml | 38 +++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/update-core-index.yml create mode 100644 .github/workflows/update-npm-index.yml diff --git a/.github/workflows/update-core-index.yml b/.github/workflows/update-core-index.yml new file mode 100644 index 000000000..f890d8851 --- /dev/null +++ b/.github/workflows/update-core-index.yml @@ -0,0 +1,38 @@ +name: "Update core index.json" +on: + push: + branches: + - main + paths: + - 'vuln/core/*.json' + - '!vuln/core/index.json' + +permissions: [read, write] + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install deps + run: | + npm install + + - name: Update core index.json + run: | + npm run update-core-index + + - name: commit and push updated results + uses: github-actions-x/commit@v2.9 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + push-branch: 'main' + commit-message: 'vuln: update core index.json' + rebase: 'true' + files: vuln/core/index.json + name: Github Actions diff --git a/.github/workflows/update-npm-index.yml b/.github/workflows/update-npm-index.yml new file mode 100644 index 000000000..9fd6a7aa4 --- /dev/null +++ b/.github/workflows/update-npm-index.yml @@ -0,0 +1,38 @@ +name: "Update npm index.json" +on: + push: + branches: + - main + paths: + - 'vuln/npm/*.json' + - '!vuln/npm/index.json' + +permissions: [read, write] + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install deps + run: | + npm install + + - name: Update npm index.json + run: | + npm run update-npm-index + + - name: commit and push updated results + uses: github-actions-x/commit@v2.9 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + push-branch: 'main' + commit-message: 'vuln: update npm index.json' + rebase: 'true' + files: vuln/npm/index.json + name: Github Actions