Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/slo-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,44 @@ jobs:
checks: write
contents: read
pull-requests: write
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Publish YDB SLO Report
uses: ydb-platform/ydb-slo-action/report@13c687b7d4b2879da79dd12932dee0ed2b65dd1c
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_run_id: ${{ github.event.workflow_run.id }}

remove-slo-label:
if: always() && github.event.workflow_run.event == 'pull_request'
name: Remove SLO Label
needs: ydb-slo-action-report
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The remove-slo-label job has a dependency issue. It declares needs: ydb-slo-action-report (line 27), but the ydb-slo-action-report job only runs when github.event.workflow_run.conclusion == 'success' (line 17).

If the workflow run fails (conclusion is 'failure', 'cancelled', 'timed_out', etc.), the ydb-slo-action-report job will be skipped. When a job is skipped, any jobs that depend on it via needs will also be skipped by default, even if they have if: always().

This means the remove-slo-label job will not run when the SLO workflow fails, which is likely not the intended behavior - the SLO label should be removed regardless of whether the workflow succeeds or fails.

To fix this, either:

  1. Remove the needs: ydb-slo-action-report dependency entirely if there's no actual dependency between these jobs, or
  2. Change the condition to if: always() && !cancelled() && github.event.workflow_run.event == 'pull_request' and add needs: [ydb-slo-action-report] with brackets to make it explicit that this job should run even if the needed job is skipped.

However, examining the logic more carefully, these two jobs appear to be independent - the label removal doesn't actually depend on the report being published. The most appropriate fix would be to remove the needs clause entirely.

Suggested change
needs: ydb-slo-action-report

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Remove SLO label from PR
uses: actions/github-script@v7
with:
script: |
const pullRequests = context.payload.workflow_run.pull_requests;
if (pullRequests && pullRequests.length > 0) {
for (const pr of pullRequests) {
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
name: 'SLO'
});
console.log(`Removed SLO label from PR #${pr.number}`);
} catch (error) {
if (error.status === 404) {
console.log(`SLO label not found on PR #${pr.number}, skipping`);
} else {
throw error;
}
}
}
} else {
console.log('No pull requests associated with this workflow run');
}
Loading