-
Notifications
You must be signed in to change notification settings - Fork 1
Fix PR and CI workflow #19
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -25,9 +25,6 @@ jobs: | |
| uses: ./.github/workflows/configs.yml | ||
|
|
||
| build-test-nodejs: | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| needs: [get-configs] | ||
| runs-on: ${{ inputs.runs-on }} | ||
| steps: | ||
|
|
@@ -56,27 +53,6 @@ jobs: | |
| if: runner.os != 'Windows' | ||
| run: npm run lint && npm run test | ||
|
|
||
| - name: Code Coverage | ||
| if: runner.os != 'Windows' && github.event_name == 'pull_request' | ||
| uses: irongut/[email protected] | ||
| with: | ||
| filename: coverage/**/cobertura-coverage.xml | ||
| badge: false | ||
| fail_below_min: false | ||
| format: markdown | ||
| hide_branch_rate: false | ||
| hide_complexity: false | ||
| indicators: true | ||
| output: both | ||
| thresholds: '80 85' | ||
|
|
||
| - name: Add Coverage PR Comment | ||
| if: runner.os != 'Windows' && github.event_name == 'pull_request' | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| with: | ||
| recreate: true | ||
| path: code-coverage-results.md | ||
|
|
||
| build-test-go: | ||
| needs: [get-configs] | ||
| runs-on: ${{ inputs.runs-on }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,10 +5,68 @@ | ||||||||||||||||||||||||||||
| branches: [ main ] | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| build-and-test: | |||||||||||||||||||||||||||||
| uses: ./.github/workflows/build-and-test.yml | |||||||||||||||||||||||||||||
| get-configs: | |||||||||||||||||||||||||||||
| uses: ./.github/workflows/configs.yml | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| pr-build-test-nodejs: | |||||||||||||||||||||||||||||
| needs: [get-configs] | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| permissions: | |||||||||||||||||||||||||||||
| contents: read | |||||||||||||||||||||||||||||
| pull-requests: write | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| ref: ${{ github.sha }} | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Node.js ${{ needs.get-configs.outputs.node-version }} | |||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| node-version: ${{ needs.get-configs.outputs.node-version }} | |||||||||||||||||||||||||||||
| cache: 'npm' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install Dependencies | |||||||||||||||||||||||||||||
| run: npm ci | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Build | |||||||||||||||||||||||||||||
| run: npm run build | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Lint and Test | |||||||||||||||||||||||||||||
| run: npm run lint && npm run test | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Code Coverage | |||||||||||||||||||||||||||||
| uses: irongut/[email protected] | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| filename: coverage/**/cobertura-coverage.xml | |||||||||||||||||||||||||||||
| badge: false | |||||||||||||||||||||||||||||
| fail_below_min: false | |||||||||||||||||||||||||||||
| format: markdown | |||||||||||||||||||||||||||||
| hide_branch_rate: false | |||||||||||||||||||||||||||||
| hide_complexity: false | |||||||||||||||||||||||||||||
| indicators: true | |||||||||||||||||||||||||||||
| output: both | |||||||||||||||||||||||||||||
| thresholds: '80 85' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Add Coverage PR Comment | |||||||||||||||||||||||||||||
| uses: marocchino/sticky-pull-request-comment@v2 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| recreate: true | |||||||||||||||||||||||||||||
| path: code-coverage-results.md | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| pr-build-test-go: | |||||||||||||||||||||||||||||
| needs: [get-configs] | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Go ${{ needs.get-configs.outputs.go-version }} | |||||||||||||||||||||||||||||
| uses: actions/setup-go@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| go-version: ${{ needs.get-configs.outputs.go-version }} | |||||||||||||||||||||||||||||
| cache: true | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Build | |||||||||||||||||||||||||||||
| shell: bash | |||||||||||||||||||||||||||||
| run: GOPROXY=direct go build -C ./cfn-init ./... | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Test | |||||||||||||||||||||||||||||
| shell: bash | |||||||||||||||||||||||||||||
| run: GOPROXY=direct go test -C ./cfn-init -v -cover ./... | |||||||||||||||||||||||||||||
|
Comment on lines
+55
to
+72
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: {contents: read}
Copilot AutofixAI 3 months ago To fix this problem, we should specify a You should add the following block beneath permissions:
contents: readThis change is entirely localized to lines 56-57 (
Suggested changeset
1
.github/workflows/pr.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 months ago
permissionsblock to theget-configsjob, explicitly restricting unnecessary repository access and specifying the minimum required scope.get-configsjob simply calls a reusable workflow and, based on its naming and usage, is unlikely to need write access, the minimal appropriate permissions would becontents: read. Place apermissions:block underget-configs:at the same indentation level asuses:..github/workflows/pr.yml, update lines 8–10 to insert apermissions:block with appropriate contents before theuses:line.