diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index ff94a7d..cad5919 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -40,6 +40,31 @@ jobs: run: | npm outdated > npm-outdated-report.txt || echo "Some packages may be outdated." + - name: Updates the outdated dependencies + run: + npx npm-check-updates -u + npm update + + - name: Commit changes push them + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add package.json package-lock.json + git commit -m "chore: update outdated npm packages" + git push origin HEAD || echo "No changes to push" + + - name: Create Pull Request for updated Dependenncies + uses: peter-evans/create-pull-request@v5 + with: + branch: update-dependencies-branch + title: "chore: update outdated npm dependencies" + body: | + This PR updates the following outdated npm dependencies: + - Updated dependencies using npm-check-updates + - Automatically created by GitHub Actions + commit-message: "chore: update outdated npm dependencies" + labels: "dependencies, automated update" + assignees: "your-github-username" # Optional: assign the PR to someone - name: Handling empty files run: | is_empty(){