Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
16 changes: 16 additions & 0 deletions .github/actions/setup-yarnrc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Setup yarn config
description: Run yarn config commands so that @navikt/ packages are resolved from github package registry, with neccessary auth.
inputs:
npmAuthToken:
description: Token that has packages:read permission for the navikt organization.
required: true

runs:
using: composite
steps:
- name: Setup yarn config
shell: bash
run: |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken ${{ inputs.npmAuthToken }}

Check failure

Code scanning / SonarCloud

GitHub Actions should not be vulnerable to script injections High

Change this action to not use user-controlled data directly in a run block. See more on SonarQube Cloud
19 changes: 10 additions & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ on:

jobs:
codeql:
name: CodeQl
permissions:
actions: read
contents: read
security-events: write
uses: navikt/fp-gha-workflows/.github/workflows/codeql.yml@main
with:
language: javascript
secrets: inherit
name: CodeQl
permissions:
actions: read
contents: read
security-events: write
uses: navikt/fp-gha-workflows/.github/workflows/codeql.yml@main
with:
language: javascript
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ jobs:
contents: write
pages: write
uses: navikt/fp-gha-workflows/.github/workflows/deploy-storybook.yml@main
secrets: inherit
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
38 changes: 16 additions & 22 deletions .github/workflows/valider-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,19 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v5

- uses: ./.github/actions/setup-yarnrc
with:
fetch-depth: 0
npmAuthToken: ${{ inputs.npmAuthToken }}

- name: Sette yarn-config
run: |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NPM_AUTH_TOKEN
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- uses: actions/setup-node@v6
- name: Sette opp node
uses: actions/setup-node@v6
with:
node-version: 22.17.1
cache: 'yarn'
cache: yarn

- name: Installere dependencies
shell: bash
run: yarn install --immutable

- name: Bygg
Expand Down Expand Up @@ -53,20 +49,18 @@ jobs:
with:
fetch-depth: 0

- name: Sette yarn-config
run: |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NPM_AUTH_TOKEN
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- uses: actions/setup-node@v6
- uses: ./.github/actions/setup-yarnrc
with:
npmAuthToken: ${{ inputs.npmAuthToken }}

- name: Sette opp node
uses: actions/setup-node@v6
with:
node-version: 22.17.1
cache: 'yarn'
cache: yarn

- name: Installere dependencies
shell: bash
run: yarn install --immutable

- name: Run knip
Expand Down
Loading