-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add Dependabot,MegaLinter workflows #56
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
Open
Wan-ZL
wants to merge
3
commits into
main
Choose a base branch
from
feature/add-ci-tools
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| # MegaLinter GitHub Action configuration | ||
| # https://megalinter.io | ||
| name: MegaLinter | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master, dev, staging] | ||
| pull_request: | ||
| branches: [main, master, dev, staging] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| megalinter: | ||
| name: MegaLinter | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: MegaLinter | ||
| id: ml | ||
| # python will be replaced by the script | ||
| uses: oxsecurity/megalinter/flavors/python@v9 | ||
| env: | ||
| VALIDATE_ALL_CODEBASE: false | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # Disable linters that are too noisy for most projects | ||
| DISABLE_LINTERS: SPELL_CSPELL,COPYPASTE_JSCPD,REPOSITORY_TRIVY,REPOSITORY_CHECKOV,REPOSITORY_GRYPE | ||
|
|
||
| - name: Archive lint reports | ||
| if: success() || failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: MegaLinter-reports | ||
| path: | | ||
| megalinter-reports | ||
| retention-days: 7 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Wan-ZL/Genesis
Length of output: 149
🏁 Script executed:
Repository: Wan-ZL/Genesis
Length of output: 1143
🏁 Script executed:
Repository: Wan-ZL/Genesis
Length of output: 988
🌐 Web query:
GitHub Actions security best practices pinning commit SHA💡 Result:
Why pin GitHub Actions to a full commit SHA?
@v1can move (intentionally or after a compromise). Pinning to a full-length commit SHA is the most reliable way to make the referenced action immutable. [1][2]How to pin (recommended pattern)
Use the commit SHA in
uses:and keep the human-friendly version in a comment:This makes the workflow reproducible while still documenting what release you intended. [2][1]
Best practices when choosing the SHA
main, and verify it’s from the official repo (not a fork). [2][1]Keep SHA-pinned actions up to date (so you don’t get stuck)
Enforce SHA pinning centrally (org/enterprise)
Don’t stop at
uses:: watch for “mutable dependencies”Even if you pin an action, it can still be risky if it pulls mutable code at runtime (e.g., unpinned container images or downloading scripts without verification). Review/avoid actions with these patterns. [1]
Sources: GitHub Docs on security hardening for GitHub Actions (pin to full-length SHA) [2], GitHub Well-Architected Actions security guidance [1], GitHub Changelog on SHA-pinning enforcement in Actions policy [3].
Pin GitHub Actions to commit SHAs to harden supply-chain security.
Using mutable tags (e.g.,
@v4,@v8) can introduce unreviewed changes. GitHub recommends pinning to full commit SHAs; keep the version tag in a comment for readability.🔒 Suggested update pattern
Verify the commit SHA matches the intended release tag in the upstream repository before pinning.
🤖 Prompt for AI Agents