From a7915ae3b0f9a0b9e8231c214303fc7d2ccca3d8 Mon Sep 17 00:00:00 2001 From: Siri Mykland Date: Mon, 1 Sep 2025 11:46:09 +0200 Subject: [PATCH 1/2] legg til MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit småfix fjern endring i yarnrc legg til actions test simel fjern scope oppdater med ny variant test ut env på config oppsett test env variablel på install test fjern always auth forenkle yarn auth for @navikt repository --- .github/actions/setup-yarnrc/action.yml | 16 +++++++++ .github/workflows/codeql-analysis.yml | 19 ++++++----- .github/workflows/deploy-storybook.yml | 3 +- .github/workflows/valider-pull-request.yml | 38 +++++++++------------- 4 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 .github/actions/setup-yarnrc/action.yml diff --git a/.github/actions/setup-yarnrc/action.yml b/.github/actions/setup-yarnrc/action.yml new file mode 100644 index 0000000000..f183d55dde --- /dev/null +++ b/.github/actions/setup-yarnrc/action.yml @@ -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 }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a9b277a56a..93270ff5e8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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 }} diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml index 007863ca8a..a8a5474795 100644 --- a/.github/workflows/deploy-storybook.yml +++ b/.github/workflows/deploy-storybook.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/valider-pull-request.yml b/.github/workflows/valider-pull-request.yml index cab6af1da4..c6c9a81b10 100644 --- a/.github/workflows/valider-pull-request.yml +++ b/.github/workflows/valider-pull-request.yml @@ -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 @@ -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 From 3bc6597811ec68e0dfe34ec1dafa4e344ed7a24b Mon Sep 17 00:00:00 2001 From: Siri Mykland Date: Thu, 30 Oct 2025 18:24:15 +0100 Subject: [PATCH 2/2] prettier --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/deploy-storybook.yml | 2 +- .github/workflows/valider-pull-request.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 93270ff5e8..d98f21e615 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,10 +1,10 @@ -name: "CodeQL" +name: 'CodeQL' on: push: - branches: [ "main" ] + branches: ['main'] pull_request: - branches: [ "main" ] + branches: ['main'] schedule: - cron: '0 0 * * 0,4' diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml index a8a5474795..e0d30af387 100644 --- a/.github/workflows/deploy-storybook.yml +++ b/.github/workflows/deploy-storybook.yml @@ -11,4 +11,4 @@ jobs: pages: write uses: navikt/fp-gha-workflows/.github/workflows/deploy-storybook.yml@main secrets: - READER_TOKEN: ${{ secrets.READER_TOKEN }} \ No newline at end of file + READER_TOKEN: ${{ secrets.READER_TOKEN }} diff --git a/.github/workflows/valider-pull-request.yml b/.github/workflows/valider-pull-request.yml index c6c9a81b10..0b7d254422 100644 --- a/.github/workflows/valider-pull-request.yml +++ b/.github/workflows/valider-pull-request.yml @@ -1,5 +1,5 @@ name: Valider pull request -on: [ pull_request ] +on: [pull_request] jobs: valid-pull-request: name: Valider pull request