From 73827411f49bee110ad0f8ec8704a0eb530866ba Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 10 Oct 2025 09:50:18 +0200 Subject: [PATCH 1/7] Add checks for news/events content changes and trigger Galaxy Social Assistant --- .github/workflows/publish.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9785fb8d52..8704871f73 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,3 +34,22 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: "us-east-2" # optional: defaults to us-east-1 SOURCE_DIR: "dist" # optional: defaults to entire repository + + - name: Check for news/events content changes + id: check_changes + run: | + if git diff --name-only HEAD~1 HEAD | grep -E '^content/(news|events)/' > /dev/null; then + echo "changes_detected=true" >> $GITHUB_OUTPUT + else + echo "changes_detected=false" >> $GITHUB_OUTPUT + fi + - name: Wait for feeds to be available + if: steps.check_changes.outputs.changes_detected == 'true' + run: sleep 30 + - name: Trigger Galaxy Social Assistant + if: steps.check_changes.outputs.changes_detected == 'true' + uses: peter-evans/repository-dispatch@v4 + with: + token: ${{ secrets.SOCIAL_ASSISTANT_DISPATCH_TOKEN }} + repository: usegalaxy-eu/galaxy-social-assistant + event-type: feed-updated From ecdcf762fd2b56a3e6ae17b9ea1f740bbfece919 Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 10 Oct 2025 10:20:32 +0200 Subject: [PATCH 2/7] Update trigger for Galaxy Social Assistant to use workflow dispatch --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8704871f73..36257af9a8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,8 +48,8 @@ jobs: run: sleep 30 - name: Trigger Galaxy Social Assistant if: steps.check_changes.outputs.changes_detected == 'true' - uses: peter-evans/repository-dispatch@v4 + uses: benc-uk/workflow-dispatch@v1 with: + workflow: feed_bot.yml + repo: usegalaxy-eu/galaxy-social-assistant token: ${{ secrets.SOCIAL_ASSISTANT_DISPATCH_TOKEN }} - repository: usegalaxy-eu/galaxy-social-assistant - event-type: feed-updated From 9cf3c18efc5914b33a0858b090bc82ffa929c1ec Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 10 Oct 2025 10:36:38 +0200 Subject: [PATCH 3/7] Add reference to main branch in Galaxy Social Assistant trigger --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 36257af9a8..a880093908 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,3 +53,4 @@ jobs: workflow: feed_bot.yml repo: usegalaxy-eu/galaxy-social-assistant token: ${{ secrets.SOCIAL_ASSISTANT_DISPATCH_TOKEN }} + ref: main From fc0c318f3257d612f9f4ac929f5df5b2a2f1ecdf Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 10 Oct 2025 10:51:27 +0200 Subject: [PATCH 4/7] Refactor Galaxy Social Assistant trigger to use dynamic token generation --- .github/workflows/publish.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a880093908..aae15d8162 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,11 +46,17 @@ jobs: - name: Wait for feeds to be available if: steps.check_changes.outputs.changes_detected == 'true' run: sleep 30 + - name: Create Galaxy Social Assistant Token + uses: actions/create-github-app-token@v2 + id: galaxy-social-assistant-token + with: + app-id: ${{ vars.GALAXY_SOCIAL_ASSISTANT_APP_ID }} + private-key: ${{ secrets.GALAXY_SOCIAL_ASSISTANT_PRIVATE_KEY }} - name: Trigger Galaxy Social Assistant if: steps.check_changes.outputs.changes_detected == 'true' uses: benc-uk/workflow-dispatch@v1 with: workflow: feed_bot.yml repo: usegalaxy-eu/galaxy-social-assistant - token: ${{ secrets.SOCIAL_ASSISTANT_DISPATCH_TOKEN }} + token: ${{ steps.galaxy-social-assistant-token.outputs.token }} ref: main From da2986d38bcd4ff0ee824e6df05117f467645342 Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 10 Oct 2025 10:52:58 +0200 Subject: [PATCH 5/7] Add owner and repository details for Galaxy Social Assistant token creation --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aae15d8162..14bbc1922d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -52,6 +52,8 @@ jobs: with: app-id: ${{ vars.GALAXY_SOCIAL_ASSISTANT_APP_ID }} private-key: ${{ secrets.GALAXY_SOCIAL_ASSISTANT_PRIVATE_KEY }} + owner: "usegalaxy-eu" + repositories: "galaxy-social-assistant" - name: Trigger Galaxy Social Assistant if: steps.check_changes.outputs.changes_detected == 'true' uses: benc-uk/workflow-dispatch@v1 From cbb5b13ccc58138f659933cdac4eb28440995d07 Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 10 Oct 2025 10:58:18 +0200 Subject: [PATCH 6/7] Ensure Galaxy Social Assistant token creation only runs when content changes are detected --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 14bbc1922d..1344050d74 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,6 +47,7 @@ jobs: if: steps.check_changes.outputs.changes_detected == 'true' run: sleep 30 - name: Create Galaxy Social Assistant Token + if: steps.check_changes.outputs.changes_detected == 'true' uses: actions/create-github-app-token@v2 id: galaxy-social-assistant-token with: From bfa24fdbb2c553540b9e88de7d7d93231139f8dc Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 10 Oct 2025 11:25:59 +0200 Subject: [PATCH 7/7] Refactor Galaxy Social Assistant trigger to use paths-filter for content change detection --- .github/workflows/publish.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1344050d74..a335e69990 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,19 +35,25 @@ jobs: AWS_REGION: "us-east-2" # optional: defaults to us-east-1 SOURCE_DIR: "dist" # optional: defaults to entire repository + galaxy-social-assistant: + needs: publish + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 - name: Check for news/events content changes + uses: dorny/paths-filter@v3 id: check_changes - run: | - if git diff --name-only HEAD~1 HEAD | grep -E '^content/(news|events)/' > /dev/null; then - echo "changes_detected=true" >> $GITHUB_OUTPUT - else - echo "changes_detected=false" >> $GITHUB_OUTPUT - fi + with: + filters: | + content: + - 'content/news/**' + - 'content/events/**' - name: Wait for feeds to be available - if: steps.check_changes.outputs.changes_detected == 'true' + if: steps.check_changes.outputs.content == 'true' run: sleep 30 - name: Create Galaxy Social Assistant Token - if: steps.check_changes.outputs.changes_detected == 'true' uses: actions/create-github-app-token@v2 id: galaxy-social-assistant-token with: @@ -56,7 +62,7 @@ jobs: owner: "usegalaxy-eu" repositories: "galaxy-social-assistant" - name: Trigger Galaxy Social Assistant - if: steps.check_changes.outputs.changes_detected == 'true' + if: steps.check_changes.outputs.content == 'true' uses: benc-uk/workflow-dispatch@v1 with: workflow: feed_bot.yml