You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you create a GitHub action that gathers all changed entries (take every modified line containing an entry with the en: prefix, an entry is each comma separated value in this line) in the files contained in the "taxonomies" folder, between 2 GitHub releases.
Automatically run the "update_all_products.sh" script with each modified tag as an argument
Pseudo code
name: Gather Changed Entries and Run Script
on:
push:
tags:
- 'v*.*.*'
jobs:
gather-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get the latest two tags
id: get-tags
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
previous_tag=$(git describe --tags `git rev-list --tags --skip=1 --max-count=1`)
echo "::set-output name=latest_tag::$latest_tag"
echo "::set-output name=previous_tag::$previous_tag"
- name: Gather changes
id: gather-changes
run: |
git diff ${{ steps.get-tags.outputs.previous_tag }} ${{ steps.get-tags.outputs.latest_tag }} -- taxonomies/ > changes.diff
grep -E '^\+\s*.*en:' changes.diff > filtered_changes.txt
tags=$(grep -o 'en:[^,]*' filtered_changes.txt | sort | uniq)
echo "::set-output name=tags::$tags"
- name: Run update_all_products.pl for each tag
run: |
for tag in ${{ steps.gather-changes.outputs.tags }}
do
./scripts/update_all_products.pl --query categories_tags=en:some-old-entry-that-is-now-a-synonym!
done
The text was updated successfully, but these errors were encountered:
Problem
Pseudo code
The text was updated successfully, but these errors were encountered: