Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to main #511

Merged
merged 27 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7c3f74d
UHF-8975: Updated the order of front page paragraph types.
khalima Jan 16, 2024
a4b4018
UHF-8975: Added weight for the content liftup paragraph and a comment…
khalima Jan 17, 2024
c5f2b30
UHF-8975: Added weight for the content liftup paragraph in standard p…
khalima Jan 17, 2024
44863cb
Merge pull request #509 from City-of-Helsinki/UHF-8975_paragraph_order
khalima Jan 18, 2024
0725826
Update configuration
actions-bot Jan 18, 2024
3d6b4e2
Reverted unwanted changes to configurations.
khalima Jan 18, 2024
39820d7
Update paragraphs.paragraphs_type.popular_services.yml
khalima Jan 18, 2024
ece6f0f
Merge pull request #510 from City-of-Helsinki/update-configuration
khalima Jan 18, 2024
1540963
UHF-9575: adding distinct true removes duplicates from filtered rss feed
rpnykanen Jan 22, 2024
c68a88d
Update configuration
actions-bot Jan 22, 2024
5b8f255
Merge pull request #512 from City-of-Helsinki/update-configuration
khalima Jan 22, 2024
b7c7dec
UHF-8975: Removed content_liftup from "etusivu" instance as the TPR m…
khalima Jan 22, 2024
4e80ae6
Merge pull request #514 from City-of-Helsinki/UHF-8975
khalima Jan 22, 2024
3a7e2b9
Merge pull request #513 from City-of-Helsinki/UHF-9575
rpnykanen Jan 22, 2024
5d2819d
Update configuration
actions-bot Jan 23, 2024
20c31d3
Merge pull request #515 from City-of-Helsinki/update-configuration
teroelonen Jan 23, 2024
df37496
UHF-9380: Added npm audit github action to run npm audit fix in custo…
khalima Jan 24, 2024
cacd9d5
UHF-9380: Handle BC breaks when running npm audit fix.
khalima Jan 25, 2024
6fecc33
UHF-9380: Simplified npm audit action.
khalima Jan 29, 2024
d3de16e
Merge pull request #516 from City-of-Helsinki/UHF-9380
khalima Jan 29, 2024
3b3189c
Update configuration
actions-bot Jan 30, 2024
d98d58c
Merge pull request #517 from City-of-Helsinki/update-configuration
teroelonen Jan 30, 2024
9993d51
Update configuration
actions-bot Jan 30, 2024
ad2220b
Merge pull request #518 from City-of-Helsinki/update-configuration
teroelonen Jan 30, 2024
a11ddfb
Update configuration
actions-bot Jan 31, 2024
acdb881
Updated helfi_platform_config.
khalima Jan 31, 2024
b4adf06
Merge pull request #519 from City-of-Helsinki/update-configuration
khalima Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/npm-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Npm audit

on:
workflow_dispatch:
schedule:
- cron: '0 12 * * 0' # Run every fortnight on Sunday at 12

jobs:
npm_audit:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run npm audit
id: npm_audit
run: |
find public/modules/custom public/themes/custom -type f -name ".nvmrc" -exec sh -c '
dir=$(dirname "$1")
node_version=$(cat "$1")
echo "Using Node.js version $node_version in $dir"
cd "$dir"
export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install $node_version
nvm use $node_version
set +e
npm audit --package-lock-only --loglevel=error;
# The npm audit command will exit with a 0 exit code if no vulnerabilities were found.
if [ $? -gt 0 ]; then
npm audit fix --package-lock-only --loglevel=error;
if [ $? -gt 0 ]; then
echo "BC_BREAK=:exclamation: NPM Audit fix could not fix all vulnerabilities. Fix them manually by running \`npm audit fix --force\` and test the functionalities thoroughly as there might be breaking changes. :exclamation:" >> $GITHUB_ENV;
fi;
echo "CREATE_PR=true" >> $GITHUB_OUTPUT;
fi;
set -e
' sh {} \;


- name: Create Pull Request
if: steps.npm_audit.outputs.CREATE_PR == 'true'
uses: peter-evans/create-pull-request@v4
with:
committer: GitHub <noreply@github.com>
author: actions-bot <actions-bot@users.noreply.github.com>
commit-message: Updated node modules based on npm audit fix
title: Automatic npm audit fix
labels: auto-update
body: |
# Npm audit

${{ env.BC_BREAK }}

## How to install

* Update the HDBT theme
* `git fetch --all`
* `git checkout automation/npm-audit`
* `git pull origin automation/npm-audit`
* In the custom module or custom theme folder, run `nvm use && npm i && npm run build`

## How to test
Run `npm audit`

* [ ] Check that the `npm audit` prints `found 0 vulnerabilities`
* [ ] Check that the changes for distributed files are sensible

branch: automation/npm-audit
Loading
Loading