Skip to content

Conversation

@sirimykland
Copy link
Contributor

@sirimykland sirimykland commented Nov 26, 2025

@sirimykland sirimykland marked this pull request as ready for review November 27, 2025 09:09
@sirimykland sirimykland requested a review from a team as a code owner November 27, 2025 09:09

This comment was marked as outdated.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +68 to +86
- name: Slett forrige kommentar fra Knip
if: github.event.pull_request.number
shell: bash
continue-on-error: true
run: gh pr comment ${{ github.event.pull_request.number }} --delete-last --yes
env:
GITHUB_TOKEN: ${{ inputs.github-token }}

- name: Post Knip rapport
if: github.event.pull_request.number
shell: bash
run: |
number_of_words=$(wc -w < knip-report.md)
if [ $number_of_words -gt 3 ]; then
gh pr comment ${{ github.event.pull_request.number }} --body-file knip-report.md
fi
env:
GITHUB_TOKEN: ${{ inputs.github-token }}

Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --delete-last flag deletes the last comment by any user on the PR, not just comments from this action. This could accidentally delete unrelated comments. Consider using a comment identifier or marker to target only Knip comments, or use a dedicated action like marocchino/sticky-pull-request-comment that can update/replace specific comments.

Suggested change
- name: Slett forrige kommentar fra Knip
if: github.event.pull_request.number
shell: bash
continue-on-error: true
run: gh pr comment ${{ github.event.pull_request.number }} --delete-last --yes
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- name: Post Knip rapport
if: github.event.pull_request.number
shell: bash
run: |
number_of_words=$(wc -w < knip-report.md)
if [ $number_of_words -gt 3 ]; then
gh pr comment ${{ github.event.pull_request.number }} --body-file knip-report.md
fi
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- name: Post/oppdater Knip rapport
if: github.event.pull_request.number
uses: marocchino/sticky-pull-request-comment@v2
with:
header: knip-report
path: knip-report.md
GITHUB_TOKEN: ${{ inputs.github-token }}

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +69
- name: Slett forrige kommentar fra Knip
if: github.event.pull_request.number
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition github.event.pull_request.number evaluates to true even when the number is 0 (which shouldn't occur but is safer to guard against). Use github.event.pull_request.number != '' or github.event_name == 'pull_request' for more robust checking.

Copilot uses AI. Check for mistakes.
required: false
type: string
description: Hvilken package manager en skal bruke (npm|pnpm|yarn)
description: Hvilken package manager en skal brukes (pnpm|yarn).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammatikk :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants