Skip to content

Commit

Permalink
Try to make build list dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
Soubinan committed Jan 11, 2025
1 parent 8a8ffaa commit f986bd1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/auto-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
branches:
- main
paths:
- '.github/auto-cleaner.js'
- '.github/workflows/auto-cleaner.yml'
- ".github/auto-cleaner.js"
- ".github/workflows/auto-cleaner.yml"
schedule:
- cron: '0 0 */3 * *'
- cron: "0 0 */3 * *"

env:
NODE_VERSION: 20.x
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,29 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: List templates
id: templates-list
- name: List changed templates
id: all-changed-templates-list
uses: tj-actions/changed-files@v45
with:
files: templates/**
if: ${{github.event_name}} == 'pull_request'

- name: List all templates
id: all-templates-list
run: |
sudo apt-get install -y jq
echo TEMPLATES_LIST="$(ls templates/* | jq -Rsc 'split("\n")[:-1]')" | tee -a $GITHUB_OUTPUT
echo all_files="$(printf '%s' "$(ls templates/*)" | jq -Rsc 'split("\n")')" | tee -a $GITHUB_OUTPUT
echo all_changed_files=$(echo -n ${{ steps.all-changed-templates-list.outputs.all_changed_files }} | jq -Rsc 'split(" ")') | tee -a $GITHUB_OUTPUT
if: ${{github.event_name}} != 'pull_request'

- name: Check templates list
id: check-templates-list
run: |
echo all_files=${{ steps.all-templates-list.outputs.all_files }}
echo all_changed_files=${{ steps.all-templates-list.outputs.all_changed_files }}
echo TEMPLATES_LIST=${{ steps.all-templates-list.outputs.all_changed_files != '[]' && steps.all-templates-list.outputs.all_changed_files || steps.all-templates-list.outputs.all_files }} | tee -a $GITHUB_OUTPUT
outputs:
templates_list: ${{steps.templates-list.outputs.TEMPLATES_LIST}}
templates_list: ${{steps.check-templates-list.outputs.TEMPLATES_LIST}}

image-build:
needs: init
Expand Down

0 comments on commit f986bd1

Please sign in to comment.