-
Notifications
You must be signed in to change notification settings - Fork 3
D-M #101
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
base: master
Are you sure you want to change the base?
D-M #101
Changes from all commits
e17f604
20318c4
d757a40
c77e348
586e111
cb38726
4c7540e
860cede
60c19df
268545f
36047d6
c2d35ba
48a2198
3233636
392362a
5be7663
87f6454
2ad4f69
fc9a2b3
b127c62
d513b80
e0bcc93
f1159c9
572cdbc
a899501
40d548e
2054361
4fd352a
82bd335
dcd0381
8561fe2
4044d9e
cccb89b
542b9dc
623dad4
8cf55e5
efa12c8
23ec7c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: "Code scanning - action" | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| schedule: | ||
| - cron: '0 19 * * 0' | ||
|
|
||
| jobs: | ||
| CodeQL-Build: | ||
|
|
||
| # CodeQL runs on ubuntu-latest and windows-latest | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # We must fetch at least the immediate parents so that if this is | ||
| # a pull request then we can checkout the head. | ||
| fetch-depth: 2 | ||
|
|
||
| # If this run was triggered by a pull request event, then checkout | ||
| # the head of the pull request instead of the merge commit. | ||
| - run: git checkout HEAD^2 | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| # Initializes the CodeQL tools for scanning. | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| # Override language selection by uncommenting this and choosing your languages | ||
| # with: | ||
| # languages: go, javascript, csharp, python, cpp, java | ||
|
|
||
| # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
| # If this step fails, then you should remove it and run the build manually (see below) | ||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v3 | ||
|
|
||
| # ℹ️ Command-line programs to run using the OS shell. | ||
| # 📚 https://git.io/JvXDl | ||
|
|
||
| # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
| # and modify them (or add more) to build your code if your project | ||
| # uses a compiled language | ||
|
|
||
| #- run: | | ||
| # make bootstrap | ||
| # make release | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| version: 2 | ||
| updates: | ||
|
|
||
| # Docker | ||
| - package-ecosystem: docker | ||
| directory: "/" | ||
| schedule: | ||
| interval: "monthly" | ||
| open-pull-requests-limit: 25 | ||
|
|
||
| # Python | ||
| - package-ecosystem: "pip" # See documentation for possible values | ||
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "monthly" | ||
| open-pull-requests-limit: 25 | ||
|
|
||
| # GitHub Actions | ||
| - package-ecosystem: "github-actions" | ||
| directory: ".github/workflows" | ||
| schedule: | ||
| interval: "monthly" | ||
| open-pull-requests-limit: 25 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| name: Manual Build & Push | ||
| on: | ||
| workflow_dispatch: | ||
| jobs: | ||
| build-push: | ||
| uses: kbase/.github/.github/workflows/reusable_build-push.yml@main | ||
| with: | ||
| name: '${{ github.event.repository.name }}-develop' | ||
| tags: br-${{ github.ref_name }} | ||
| secrets: inherit | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||
| name: Pull Request Build, Tag, & Push | ||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||
| - develop | ||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||
| - master | ||||||||||||||||||||||||||
| types: | ||||||||||||||||||||||||||
| - opened | ||||||||||||||||||||||||||
| - reopened | ||||||||||||||||||||||||||
| - synchronize | ||||||||||||||||||||||||||
| - closed | ||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||
| build-develop-open: | ||||||||||||||||||||||||||
| if: github.base_ref == 'develop' && github.event.pull_request.merged == false | ||||||||||||||||||||||||||
| uses: kbase/.github/.github/workflows/reusable_build.yml@main | ||||||||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||||||||
| build-develop-merge: | ||||||||||||||||||||||||||
|
Comment on lines
+16
to
+19
Check warningCode 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 AutofixAI 2 months ago To resolve this problem, add a The change should be made by inserting the following at the top level (after the permissions:
contents: readNo additional code, dependencies, or imports are required beyond amending this block.
Suggested changeset
1
.github/workflows/pr_build.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| if: github.base_ref == 'develop' && github.event.pull_request.merged == true | ||||||||||||||||||||||||||
| uses: kbase/.github/.github/workflows/reusable_build-push.yml@main | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| name: '${{ github.event.repository.name }}-develop' | ||||||||||||||||||||||||||
| tags: pr-${{ github.event.number }},latest | ||||||||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||||||||
| build-main-open: | ||||||||||||||||||||||||||
|
Comment on lines
+20
to
+26
Check warningCode 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 AutofixAI 2 months ago To fix this problem, we should explicitly add a The file to edit is permissions:
contents: readIf you know or later find that more permissions are needed for the actions performed, you can expand this to include those additional keys. Place this block after the
Suggested changeset
1
.github/workflows/pr_build.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false | ||||||||||||||||||||||||||
| uses: kbase/.github/.github/workflows/reusable_build-push.yml@main | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| name: '${{ github.event.repository.name }}' | ||||||||||||||||||||||||||
| tags: pr-${{ github.event.number }} | ||||||||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||||||||
| build-main-merge: | ||||||||||||||||||||||||||
|
Comment on lines
+27
to
+33
Check warningCode 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 AutofixAI 2 months ago To address the issue, add a top-level Changes required:
Suggested changeset
1
.github/workflows/pr_build.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == true | ||||||||||||||||||||||||||
| uses: kbase/.github/.github/workflows/reusable_build-push.yml@main | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| name: '${{ github.event.repository.name }}' | ||||||||||||||||||||||||||
| tags: pr-${{ github.event.number }},latest-rc | ||||||||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||||||||
| trivy-scans: | ||||||||||||||||||||||||||
|
Comment on lines
+34
to
+40
Check warningCode 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 AutofixAI 2 months ago To fix the problem, a The single best way to fix the problem, without changing any existing functionality, is to insert: permissions:
contents: readon a new line after the workflow
Suggested changeset
1
.github/workflows/pr_build.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||
|
Comment on lines
+41
to
+43
Check warningCode 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 AutofixAI 2 months ago To fix the problem, add a permissions:
contents: readat the top level (between lines 2 and 3), directly under the
Suggested changeset
1
.github/workflows/pr_build.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||
| name: Release - Build & Push Image | ||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||
| - master | ||||||||||||||||||||||||||
| types: [ published ] | ||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||
| check-source-branch: | ||||||||||||||||||||||||||
| uses: kbase/.github/.github/workflows/reusable_validate-branch.yml@main | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| build_branch: '${{ github.event.release.target_commitish }}' | ||||||||||||||||||||||||||
| validate-release-tag: | ||||||||||||||||||||||||||
|
Comment on lines
+11
to
+14
Check warningCode 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 AutofixAI 2 months ago To fix this problem, you should add the permissions:
contents: readIf any of the reusable workflows absolutely require more permissions, you should grant those specifically; otherwise, start with minimal permissions and escalate only if necessary.
Suggested changeset
1
.github/workflows/release-main.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| needs: check-source-branch | ||||||||||||||||||||||||||
| uses: kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| release_tag: '${{ github.event.release.tag_name }}' | ||||||||||||||||||||||||||
| build-push: | ||||||||||||||||||||||||||
|
Comment on lines
+15
to
+19
Check warningCode 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 AutofixAI 2 months ago To fix this issue, we should add a The fix requires adding a permissions:
contents: readIf later analysis shows jobs require further permissions, those can be added.
Suggested changeset
1
.github/workflows/release-main.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| needs: validate-release-tag | ||||||||||||||||||||||||||
| uses: kbase/.github/.github/workflows/reusable_build-push.yml@main | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| name: '${{ github.event.repository.name }}' | ||||||||||||||||||||||||||
| tags: '${{ github.event.release.tag_name }},latest' | ||||||||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||||||||
|
Comment on lines
+20
to
+25
Check warningCode 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 AutofixAI 2 months ago To fix this problem, you should add a How to fix:
Where to change:
Suggested changeset
1
.github/workflows/release-main.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,50 @@ | ||
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
|
||
| name: Run tests | ||
| name: Run search_api2 tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "*" ] | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - ready_for_review | ||
| push: | ||
| # run workflow when merging to main or develop | ||
| branches: | ||
| - main | ||
| - master | ||
| - develop | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: [3.7] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v2 | ||
| - name: Check out GitHub repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| python-version: 3.9.19 | ||
|
|
||
| - name: Pip installation | ||
| run: python -m pip install --upgrade pip poetry | ||
|
|
||
| - name: Poetry installation | ||
| run: poetry install | ||
| run: poetry install --no-root | ||
|
|
||
| - name: Create test image | ||
| run: docker-compose build | ||
| run: docker compose build | ||
|
|
||
| - name: Run tests | ||
| run: scripts/run_tests | ||
| - name: Codecov | ||
| uses: codecov/codecov-action@v1 | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| file: ./coverage.xml | ||
| fail_ci_if_error: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| version: '3' | ||
|
|
||
| # This docker-compose is for developer convenience, not for running in production. | ||
|
|
||
| services: | ||
|
|
||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 2 months ago
To fix the problem, add an explicit
permissions:block at the root level of the workflow file.github/workflows/manual-build.yml(typically after thename:and beforeon:), or inside the job definition. The block should grant only the privileges necessary for the workflow to function. Since the workflow delegates all steps via a reusable workflow and doesn't contain steps itself, the minimal permissions are likely sufficient (e.g.,contents: read). If the invoked workflow performs actions like pushing commits, creating releases, or interacting with pull requests, those permissions can be scoped down as needed in the reusable workflow. For now, settingpermissions: contents: readat the root level is the recommended fix, which allows jobs to read repository contents via theGITHUB_TOKENbut not write.