[Taxonomy Tree]: Italian Translations tende and teli per bagno need updating #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate and commit distribution files to requested PR | |
on: | |
workflow_dispatch: | |
issue_comment: | |
types: [created, edited] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
generate_dist: | |
if: | | |
github.repository_owner == 'Shopify' && | |
github.event.issue.pull_request && | |
github.event.comment.body == '/generate_dist' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
# Checkout code | |
- uses: actions/checkout@v4 | |
- name: Checkout PR | |
run: gh pr checkout ${{ github.event.issue.number }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Setup dependencies | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- uses: cue-lang/[email protected] | |
with: | |
version: 'v0.7.0' | |
- name: Cache b3sum | |
id: cache-b3sum | |
uses: actions/cache@v3 | |
with: | |
path: /usr/local/bin/b3sum | |
key: ${{ runner.os }}-b3sum-1.5.3 | |
- name: Install b3sum | |
if: steps.cache-b3sum.outputs.cache-hit != 'true' | |
run: | | |
curl -L https://github.com/BLAKE3-team/BLAKE3/releases/download/1.5.3/b3sum_linux_x64_bin -o b3sum | |
chmod +x b3sum | |
sudo mv b3sum /usr/local/bin/ | |
# Generate distribution files | |
- name: Keep only data/*.yml files | |
run: | | |
git fetch origin main:main | |
git checkout main -- . | |
git checkout HEAD -- data/**/*.yml | |
git reset | |
- name: Generate distribution files | |
run: VERBOSE=1 make build | |
# Create manifest and upload everything | |
- name: Create distribution manifest | |
run: | | |
find dist -type f -print0 | sort -z | xargs -0 b3sum > manifest.b3 | |
echo -n "${{ secrets.MANIFEST_KEY }}" | b3sum --keyed manifest.b3 > manifest.b3.sig | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: | | |
dist/ | |
manifest.b3 | |
manifest.b3.sig | |
commit_dist: | |
runs-on: ubuntu-latest | |
needs: generate_dist | |
permissions: | |
contents: write | |
steps: | |
# Checkout code | |
- uses: actions/checkout@v4 | |
- name: Checkout PR | |
run: gh pr checkout ${{ github.event.issue.number }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Verify and apply distribution files | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: . | |
- name: Cache b3sum | |
id: cache-b3sum | |
uses: actions/cache@v3 | |
with: | |
path: /usr/local/bin/b3sum | |
key: ${{ runner.os }}-b3sum-1.5.3 | |
- name: Install b3sum | |
if: steps.cache-b3sum.outputs.cache-hit != 'true' | |
run: | | |
curl -L https://github.com/BLAKE3-team/BLAKE3/releases/download/1.5.3/b3sum_linux_x64_bin -o b3sum | |
chmod +x b3sum | |
sudo mv b3sum /usr/local/bin/ | |
- name: Verify file integrity | |
run: | | |
echo -n "${{ secrets.MANIFEST_KEY }}" | b3sum --keyed manifest.b3 > verify.sig | |
if ! (cmp -s manifest.b3.sig verify.sig && b3sum dist --check manifest.b3); then | |
echo "Error: Integrity check failed. Manifest signature or file integrity mismatch." | |
exit 1 | |
fi | |
- name: Commit distribution files | |
run: | | |
git config --local user.name "GitHub Action" | |
git config --local user.email "[email protected]" | |
git add dist | |
git commit -m "🤖 Update distribution files" || exit 0 # Exit gracefully if no changes | |
git push |