feat: adding quality gate starter workflow#1
Conversation
c2eee81 to
cf59eff
Compare
eskenazit
left a comment
There was a problem hiding this comment.
Thanks for adding this starter workflow — nice first quality-gate template. Found (1) and (2) which are functional bugs that will silently break the two headline features (badge push + PR comment) in common scenarios, plus a few lower-priority nits.
|
|
||
| - name: Post or update PR comment | ||
| if: github.event_name == 'pull_request' | ||
| uses: marocchino/sticky-pull-request-comment@v2 |
There was a problem hiding this comment.
(1) The "Deploy badge to badges branch" step and this "sticky-pull-request-comment" step run unconditionally on pull_request events. For PRs from forks, GitHub forces GITHUB_TOKEN to read-only regardless of the permissions: block declared above — so the badge push and this PR comment will silently fail on any external-contributor PR, defeating the two headline features of this template.
| # different branches never overwrites another branch's badge. | ||
| - name: Generate badge JSON | ||
| run: | | ||
| BRANCH_SLUG=$(echo "${{ github.ref_name }}" | tr '/' '-') |
There was a problem hiding this comment.
(2) On pull_request events, github.ref_name resolves to the PR merge ref (e.g. 123/merge), not the source branch name — so the badge lands in a 123-merge folder instead of the real branch, defeating the "each branch gets its own subfolder" intent stated above. Consider using github.head_ref || github.ref_name instead.
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| with: | ||
| header: quality-gate-report | ||
| path: pr-comment-body.md No newline at end of file |
There was a problem hiding this comment.
(3) Missing trailing newline at end of file.
| { | ||
| "name": "Quality Gate", | ||
| "description": "Quality Gate workflow ready to use. Recommended starting point for any new codebase.", | ||
| "iconName": "quality-gate", |
There was a problem hiding this comment.
(4) No matching quality-gate.svg was added alongside this properties file. GitHub falls back to a default icon without it, but a dedicated SVG would improve how the template appears in the Actions template gallery. Also missing a trailing newline at end of file.
| { | ||
| "name": "Quality Gate", | ||
| "description": "Quality Gate workflow ready to use. Recommended starting point for any new codebase.", | ||
| "iconName": "quality-gate", |
There was a problem hiding this comment.
(5) This properties file has no filePatterns field, so the template is suggested to every repo in the org, including PoCs and non-code repos that may not want it imposed. Consider adding an explicit opt-in marker instead of stack auto-detection, e.g. "filePatterns": ["\\.github/quality-gate-enabled$"], and documenting that marker file in this repo's README/CONTRIBUTING so maintainers know how to opt in.
cf59eff to
7fa0aad
Compare
7fa0aad to
4f491c1
Compare
Workflow templates (Actions) to choose from when wanting to code an action.
a good use case is the workflow-templates/quality-gate.yml where we already have some implementaion (unit testing, badges) to accelerate the task for developpers