Commit e93a268
authored
fix: make GS Scorecard label-triggered but required for merging to main (#468)
## Summary
- GSSA now only executes when the `execute_gs_scorecard` label is
applied (no longer auto-runs on PRs to main)
- For PRs targeting `main`, GSSA must have completed (pass or fail)
before the PR can merge -- if skipped, `pre-publish` blocks with a clear
error annotation and step summary message
- Push to `main` continues to auto-run GSSA
- Push to `develop`/`release/*`, schedule, and dispatch no longer run
GSSA
## Changes
### `setup-workflow` job
- Removed `execute_gs_scorecard` from `TESTS_TO_CONSIDER_FOR_EXECUTION`
(no longer auto-enabled by branch/event logic)
- Added explicit GSSA control after the `esac`: enables only when label
is present (any PR) or on push to main
### `pre-publish` job
- Added `run-gs-scorecard` to the `needs` list
- Added a check: if the event is a PR to `main` and GSSA result is
`skipped`, outputs `::error::` annotation, writes to
`$GITHUB_STEP_SUMMARY`, and sets `run-publish=false`
- Modified the existing jq filter to exclude `run-gs-scorecard` via
`del(.["run-gs-scorecard"])` so GSSA failure doesn't block other checks
## Test results
Tested on [splunk/splunk-add-on-for-ibm-websphere-application-server PR
#388](splunk/splunk-add-on-for-ibm-websphere-application-server#388):
| Test | Workflow Run | Result |
|---|---|---|
| PR to main **without** label — GSSA should be skipped, pre-publish
should block | [Run
#22358328636](https://github.com/splunk/splunk-add-on-for-ibm-websphere-application-server/actions/runs/22358328636)
| PASS — GSSA skipped, pre-publish set `run-publish=false` with error
annotation |
| PR to main **with** `execute_gs_scorecard` label — GSSA should run,
pre-publish should proceed | [Run
#22370270246](https://github.com/splunk/splunk-add-on-for-ibm-websphere-application-server/actions/runs/22370270246)
| PASS — GSSA ran (failed), pre-publish succeeded (result ignored) |
JIRA: [ADDON-85652](https://splunk.atlassian.net/browse/ADDON-85652)1 parent 8af1eaf commit e93a268
1 file changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | 259 | | |
264 | 260 | | |
265 | 261 | | |
| |||
328 | 324 | | |
329 | 325 | | |
330 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
331 | 335 | | |
332 | 336 | | |
333 | 337 | | |
| |||
2917 | 2921 | | |
2918 | 2922 | | |
2919 | 2923 | | |
| 2924 | + | |
2920 | 2925 | | |
2921 | 2926 | | |
2922 | 2927 | | |
| |||
2925 | 2930 | | |
2926 | 2931 | | |
2927 | 2932 | | |
2928 | | - | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
2929 | 2946 | | |
2930 | 2947 | | |
2931 | 2948 | | |
| |||
0 commit comments