From 957fa4d9e3530ba0c8773a92943f42263b25ca1f Mon Sep 17 00:00:00 2001 From: Dino Date: Wed, 8 Apr 2026 17:58:16 +0100 Subject: [PATCH] fix: fix compliance report file upload (#53424) Release Notes: - N/A Co-authored-by: Conrad Irwin --- .github/workflows/compliance_check.yml | 8 ++++---- .github/workflows/release.yml | 16 ++++++++-------- tooling/xtask/src/tasks/workflows/release.rs | 9 ++++----- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/compliance_check.yml b/.github/workflows/compliance_check.yml index c8bce3302ada3e56564616f145ac660fdc743d20..d8c0493d41a10527a406cc5a28e8cfadcc989847 100644 --- a/.github/workflows/compliance_check.yml +++ b/.github/workflows/compliance_check.yml @@ -37,7 +37,7 @@ jobs: name: compliance_check::scheduled_compliance_check::run_compliance_check run: | echo "tag=$LATEST_TAG" >> "$GITHUB_OUTPUT" - cargo xtask compliance "$LATEST_TAG" --branch main --report-path compliance-report + cargo xtask compliance "$LATEST_TAG" --branch main --report-path compliance-report.md env: LATEST_TAG: ${{ steps.determine-version.outputs.tag }} GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }} @@ -47,14 +47,14 @@ jobs: uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: name: compliance-report.md - path: target/compliance-report.md + path: compliance-report.md if-no-files-found: error - name: send_compliance_slack_notification if: always() run: | REPORT_CONTENT="" - if [ -f "target/compliance-report.md" ]; then - REPORT_CONTENT=$(cat "target/compliance-report.md") + if [ -f "compliance-report.md" ]; then + REPORT_CONTENT=$(cat "compliance-report.md") fi if [ "$COMPLIANCE_OUTCOME" == "success" ]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f20f64c7a54151fedcd3b4e36b4dc492578b827d..b8a2c417c8a022be1a70b15ea89ba1b095d9c058 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -311,7 +311,7 @@ jobs: - id: run-compliance-check name: release::compliance_check::run_compliance_check run: | - cargo xtask compliance "$GITHUB_REF_NAME" --report-path compliance-report + cargo xtask compliance "$GITHUB_REF_NAME" --report-path compliance-report.md env: GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }} GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }} @@ -320,14 +320,14 @@ jobs: uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: name: compliance-report.md - path: target/compliance-report.md + path: compliance-report.md if-no-files-found: error - name: send_compliance_slack_notification if: always() run: | REPORT_CONTENT="" - if [ -f "target/compliance-report.md" ]; then - REPORT_CONTENT=$(cat "target/compliance-report.md") + if [ -f "compliance-report.md" ]; then + REPORT_CONTENT=$(cat "compliance-report.md") fi if [ "$COMPLIANCE_OUTCOME" == "success" ]; then @@ -681,7 +681,7 @@ jobs: - id: run-post-upload-compliance-check name: release::validate_release_assets::run_post_upload_compliance_check run: | - cargo xtask compliance "$GITHUB_REF_NAME" --report-path compliance-report + cargo xtask compliance "$GITHUB_REF_NAME" --report-path compliance-report.md env: GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }} GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }} @@ -690,14 +690,14 @@ jobs: uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: name: compliance-report.md - path: target/compliance-report.md + path: compliance-report.md if-no-files-found: error - name: send_compliance_slack_notification if: always() run: | REPORT_CONTENT="" - if [ -f "target/compliance-report.md" ]; then - REPORT_CONTENT=$(cat "target/compliance-report.md") + if [ -f "compliance-report.md" ]; then + REPORT_CONTENT=$(cat "compliance-report.md") fi if [ "$COMPLIANCE_OUTCOME" == "success" ]; then diff --git a/tooling/xtask/src/tasks/workflows/release.rs b/tooling/xtask/src/tasks/workflows/release.rs index 27f78fd74c2652f623197e3e9207dc6b91fa5c56..47e37f70dcb0542544ab0bce63a8a47fc4c851d2 100644 --- a/tooling/xtask/src/tasks/workflows/release.rs +++ b/tooling/xtask/src/tasks/workflows/release.rs @@ -151,8 +151,7 @@ pub(crate) fn create_sentry_release() -> Step { .add_with(("environment", "production")) } -pub(crate) const COMPLIANCE_REPORT_PATH: &str = "compliance-report"; -const COMPLIANCE_REPORT_FILE: &str = "target/compliance-report.md"; +pub(crate) const COMPLIANCE_REPORT_PATH: &str = "compliance-report.md"; const NEEDS_REVIEW_PULLS_URL: &str = "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22"; pub(crate) enum ComplianceContext { @@ -166,7 +165,7 @@ pub(crate) fn add_compliance_notification_steps( compliance_step_id: &str, ) -> gh_workflow::Job { let upload_step = - upload_artifact(COMPLIANCE_REPORT_FILE).if_condition(Expression::new("always()")); + upload_artifact(COMPLIANCE_REPORT_PATH).if_condition(Expression::new("always()")); let (success_prefix, failure_prefix) = match context { ComplianceContext::Release => ("✅ Compliance check passed", "❌ Compliance check failed"), @@ -178,8 +177,8 @@ pub(crate) fn add_compliance_notification_steps( let script = formatdoc! {r#" REPORT_CONTENT="" - if [ -f "{COMPLIANCE_REPORT_FILE}" ]; then - REPORT_CONTENT=$(cat "{COMPLIANCE_REPORT_FILE}") + if [ -f "{COMPLIANCE_REPORT_PATH}" ]; then + REPORT_CONTENT=$(cat "{COMPLIANCE_REPORT_PATH}") fi if [ "$COMPLIANCE_OUTCOME" == "success" ]; then