feat(bitbucket): Update generator template to match pull requests#7421
Open
yermulnik wants to merge 4 commits intooxsecurity:mainfrom
Open
feat(bitbucket): Update generator template to match pull requests#7421yermulnik wants to merge 4 commits intooxsecurity:mainfrom
yermulnik wants to merge 4 commits intooxsecurity:mainfrom
Conversation
Related to oxsecurity#7410, oxsecurity#7412 Details: MegaLInter requires `BITBUCKET_PR_ID` env variable to exist. This variable is only available on a pull request triggered builds. Therefore update generator template to trigger builds on pull requests from any branch. Ref: https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ (look up `BITBUCKET_PR_ID` variable)
There was a problem hiding this comment.
Pull request overview
This PR updates the Bitbucket Pipelines generator template so MegaLinter runs in a pull-request context, where Bitbucket provides PR-specific environment variables (notably BITBUCKET_PR_ID) required for PR comment reporting.
Changes:
- Replaces the
pipelines: defaulttrigger with apipelines: pull-requeststrigger matching all branches ("**"). - Keeps the existing MegaLinter execution step and LLM-advisor bot detection logic under the PR pipeline.
mega-linter-runner/generators/mega-linter/templates/bitbucket-pipelines.yml
Show resolved
Hide resolved
mega-linter-runner/generators/mega-linter/templates/bitbucket-pipelines.yml
Outdated
Show resolved
Hide resolved
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to #7410, #7412
Details: MegaLInter requires
BITBUCKET_PR_IDenv variable to exist. This variable is only available on a pull request triggered builds. Therefore update generator template to trigger builds on pull requests from any branch.Ref: https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ (look up
BITBUCKET_PR_IDvariable)Fixes #7410
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breakingif this is a large fundamental changeautomation,bug,documentation,enhancement,infrastructure, orperformanceNote
Low Risk
Low risk CI-template change that only affects when the generated Bitbucket pipeline triggers; no runtime or security-sensitive code paths are modified.
Overview
Updates the Bitbucket Pipelines generator template to run MegaLinter in
pull-requestscontext for any source branch (instead ofdefault), ensuring PR-specific env vars (e.g.,BITBUCKET_PR_ID) are available for reporting.Adds a corresponding entry to
CHANGELOG.mdunder Reporters.Written by Cursor Bugbot for commit ed8488f. This will update automatically on new commits. Configure here.