From 06f650f5f4578fc4303abbdd502585d1c8e4481e Mon Sep 17 00:00:00 2001
From: David Robertson <davidr@element.io>
Date: Tue, 26 Sep 2023 15:21:07 +0100
Subject: [PATCH] Skip export-data on non-code (e.g. docs) PRs (#16387)

---
 .github/workflows/tests.yml | 7 ++++---
 changelog.d/16387.misc      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 100644 changelog.d/16387.misc

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 045d3dd257..96750cb6c8 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -499,8 +499,8 @@ jobs:
             /logs/**/*.log*
 
   export-data:
-    if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
-    needs: [linting-done, portdb]
+    if: ${{ !failure() && !cancelled() && needs.changes.outputs.integration == 'true'}} # Allow previous steps to be skipped, but not fail
+    needs: [linting-done, portdb, changes]
     runs-on: ubuntu-latest
     env:
       TOP: ${{ github.workspace }}
@@ -535,7 +535,7 @@ jobs:
 
 
   portdb:
-    if: ${{ !failure() && !cancelled() && needs.changes.outputs.linting == 'true' }} # Allow previous steps to be skipped, but not fail
+    if: ${{ !failure() && !cancelled() && needs.changes.outputs.integration == 'true'}} # Allow previous steps to be skipped, but not fail
     needs:
       - linting-done
       - changes
@@ -702,6 +702,7 @@ jobs:
             trial-olddeps
             sytest
             portdb
+            export-data
             complement
             check-signoff
             lint-newsfile
diff --git a/changelog.d/16387.misc b/changelog.d/16387.misc
new file mode 100644
index 0000000000..eae0501d6b
--- /dev/null
+++ b/changelog.d/16387.misc
@@ -0,0 +1 @@
+Avoid running CI steps when the files they check have not been changed.
\ No newline at end of file
-- 
GitLab