Skip to content

Create ngrok.yaml#137

Closed
bio-boris wants to merge 25 commits intodevelopfrom
bio-boris-patch-1
Closed

Create ngrok.yaml#137
bio-boris wants to merge 25 commits intodevelopfrom
bio-boris-patch-1

Conversation

@bio-boris
Copy link
Copy Markdown
Collaborator

@bio-boris bio-boris commented Apr 5, 2024

Don't use, in favor of printing out what you need using AI

@bio-boris bio-boris closed this Apr 5, 2024
@bio-boris bio-boris deleted the bio-boris-patch-1 branch April 5, 2024 22:00
@bio-boris bio-boris restored the bio-boris-patch-1 branch February 4, 2025 20:18
@bio-boris bio-boris reopened this Feb 4, 2025
@bio-boris bio-boris closed this Feb 4, 2025
@bio-boris bio-boris deleted the bio-boris-patch-1 branch February 4, 2025 20:22
@bio-boris bio-boris restored the bio-boris-patch-1 branch February 6, 2025 21:40
@bio-boris bio-boris deleted the bio-boris-patch-1 branch February 6, 2025 21:40
@bio-boris bio-boris restored the bio-boris-patch-1 branch February 6, 2025 21:40
@bio-boris bio-boris reopened this Feb 6, 2025
@bio-boris bio-boris closed this Mar 11, 2025
@bio-boris bio-boris deleted the bio-boris-patch-1 branch September 10, 2025 17:50
@bio-boris bio-boris restored the bio-boris-patch-1 branch April 1, 2026 17:53
@bio-boris bio-boris reopened this Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 17:54
Copy link
Copy Markdown

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

Adds a new GitHub Actions workflow intended to enable remote debugging, and updates the existing PR build workflow by disabling Trivy scanning.

Changes:

  • Commented out the trivy-scans job in the PR build workflow.
  • Added a new workflow (ngrok.yaml) that starts an interactive upterm session on runner execution.

Reviewed changes

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

File Description
.github/workflows/pr_build.yml Disables (comments out) the Trivy scan job for PR builds.
.github/workflows/ngrok.yaml Introduces a push-triggered workflow that checks out code and starts an upterm session, exporting several secrets into the environment.

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

Comment on lines +40 to +43
# trivy-scans:
# if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
# uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
# secrets: inherit
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Trivy scanning job has been fully commented out, which removes vulnerability scanning from PR builds. If this is intended to be temporary, consider gating it behind an explicit opt-out input/label or fixing the underlying failure so the scans still run for eligible PRs.

Suggested change
# trivy-scans:
# if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
# uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
# secrets: inherit
trivy-scans:
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false && !contains(join(github.event.pull_request.labels.*.name, ','), 'skip-trivy-scan')
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
secrets: inherit

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +18
- uses: actions/checkout@v2

- name: Setup upterm session
uses: lhotari/action-upterm@v1
env:
KBASE_CI_TOKEN: ${{ secrets.KBASE_CI_TOKEN }}
KBASE_CI_TOKEN2: ${{ secrets.KBASE_CI_TOKEN2 }}
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
KBASE_TEST_TOKEN2: ${{ secrets.KBASE_TEST_TOKEN2 }}
KBASE_BOT_TOKEN_CI: ${{ secrets.KBASE_BOT_TOKEN_CI }}
KBASE_BOT_USER_CI: ${{ secrets.KBASE_BOT_USER_CI }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The steps: list is not indented correctly. The - uses: actions/checkout@v2 item (and following steps) must be nested under steps: (e.g., additional indentation) or the workflow YAML will be invalid and fail to load.

Suggested change
- uses: actions/checkout@v2
- name: Setup upterm session
uses: lhotari/action-upterm@v1
env:
KBASE_CI_TOKEN: ${{ secrets.KBASE_CI_TOKEN }}
KBASE_CI_TOKEN2: ${{ secrets.KBASE_CI_TOKEN2 }}
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
KBASE_TEST_TOKEN2: ${{ secrets.KBASE_TEST_TOKEN2 }}
KBASE_BOT_TOKEN_CI: ${{ secrets.KBASE_BOT_TOKEN_CI }}
KBASE_BOT_USER_CI: ${{ secrets.KBASE_BOT_USER_CI }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
- uses: actions/checkout@v2
- name: Setup upterm session
uses: lhotari/action-upterm@v1
env:
KBASE_CI_TOKEN: ${{ secrets.KBASE_CI_TOKEN }}
KBASE_CI_TOKEN2: ${{ secrets.KBASE_CI_TOKEN2 }}
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
KBASE_TEST_TOKEN2: ${{ secrets.KBASE_TEST_TOKEN2 }}
KBASE_BOT_TOKEN_CI: ${{ secrets.KBASE_BOT_TOKEN_CI }}
KBASE_BOT_USER_CI: ${{ secrets.KBASE_BOT_USER_CI }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,18 @@
name: CI
on: [push]
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This workflow is triggered on every push, but it sets up an interactive upterm session. That effectively creates a remote shell on every push and can be used to exfiltrate data; it should be restricted (e.g., workflow_dispatch only, and ideally limited to specific branches/actors).

Suggested change
on: [push]
on:
workflow_dispatch:

Copilot uses AI. Check for mistakes.
KBASE_TEST_TOKEN2: ${{ secrets.KBASE_TEST_TOKEN2 }}
KBASE_BOT_TOKEN_CI: ${{ secrets.KBASE_BOT_TOKEN_CI }}
KBASE_BOT_USER_CI: ${{ secrets.KBASE_BOT_USER_CI }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Multiple long-lived secrets are exported into the environment of an interactive session. This materially increases the risk of secret exposure; avoid injecting these secrets into the upterm session (or switch to short-lived credentials / only provide the minimum required secret(s)).

Suggested change
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}

Copilot uses AI. Check for mistakes.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

actions/checkout@v2 is outdated and has known issues compared to newer major versions. Update to the current supported actions/checkout@v4 unless there is a compatibility constraint.

Suggested change
- uses: actions/checkout@v2
- uses: actions/checkout@v4

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,18 @@
name: CI
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

File/workflow naming is confusing: the workflow file is ngrok.yaml, but it configures an upterm session and the workflow name is the generic CI. Consider renaming the workflow/file (or adjusting the content) so it reflects its purpose and doesn't look like the primary CI pipeline.

Suggested change
name: CI
name: Upterm debug session (ngrok)

Copilot uses AI. Check for mistakes.
@bio-boris bio-boris closed this Apr 1, 2026
@bio-boris bio-boris reopened this Apr 1, 2026
Comment on lines +6 to +22
runs-on: ubuntu-latest
env:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
steps:
- name: Check token scopes
run: |
curl -sI \
-H "Authorization: Bearer $GHCR_TOKEN" \
https://api.github.com/user \
| grep -i "x-oauth-scopes\|x-accepted-oauth-scopes"

- name: Check token owner
run: |
curl -s \
-H "Authorization: Bearer $GHCR_TOKEN" \
https://api.github.com/user \
| jq '{login, type, site_admin}'

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 8 days ago

In general, this problem is fixed by explicitly declaring a permissions block either at the workflow root (applies to all jobs) or per-job, and setting it to the minimal access needed. For this specific workflow, the job only uses a custom secret and calls the GitHub API; it does not perform any write operations. The safest and simplest fix is to add a root-level permissions block setting contents: read, which is the minimal common baseline and satisfies the CodeQL requirement while preserving behavior.

Concretely, in .github/workflows/ngrok.yaml, add a permissions: section after the on: declaration so it applies to all jobs. No additional imports or methods are needed because this is a YAML configuration change only. The rest of the workflow (the inspect job, environment variables, and steps) remains unchanged.

Suggested changeset 1
.github/workflows/ngrok.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ngrok.yaml b/.github/workflows/ngrok.yaml
--- a/.github/workflows/ngrok.yaml
+++ b/.github/workflows/ngrok.yaml
@@ -1,5 +1,7 @@
 name: Inspect GHCR Token
 on: [pull_request]
+permissions:
+  contents: read
 
 jobs:
   inspect:
EOF
@@ -1,5 +1,7 @@
name: Inspect GHCR Token
on: [pull_request]
permissions:
contents: read

jobs:
inspect:
Copilot is powered by AI and may make mistakes. Always verify output.
@bio-boris bio-boris closed this Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@6873c95). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #137   +/-   ##
==========================================
  Coverage           ?   81.02%           
==========================================
  Files              ?        8           
  Lines              ?     2846           
  Branches           ?        0           
==========================================
  Hits               ?     2306           
  Misses             ?      540           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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