Skip to content

Commit baff803

Browse files
Fix "Update Tailwind" action
`tailwindcss-cli build` chokes on `require('tailwindcss/defaultTheme')` in tailwind.config.js added by 53089c1. Example failure: https://github.com/rails/tailwindcss-rails/runs/1725407564. `tailwind build`, which is invoked by `yarn build`, handles this properly. Running `yarn upgrade tailwindcss` beforehand ensures that the `tailwind build` command is installed, and updates the Tailwind version in yarn.lock to match the built tailwind.css.
1 parent 1777975 commit baff803

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/update-tailwind.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ jobs:
1111
timeout-minutes: 10
1212
steps:
1313
- uses: actions/checkout@master
14-
- name: Update app/assets/stylesheets/tailwind.css
14+
15+
- name: Update tailwind.css
1516
run: |
16-
npx tailwindcss-cli@latest build -o app/assets/stylesheets/tailwind.css
17-
- name: Commit files
17+
yarn upgrade tailwindcss
18+
yarn build
19+
20+
- name: Commit changes
1821
run: |
19-
TAILWIND_CSS_VERSION=`npm view tailwindcss@latest version`
2022
git config --local user.email "github-actions@example.com"
2123
git config --local user.name "GitHub Actions"
22-
git add app/assets/stylesheets/tailwind.css
23-
git commit -am "[nodoc] Updating Tailwind CSS to $TAILWIND_CSS_VERSION" || echo "No changes to commit"
24+
git commit -am "Update tailwind.css" || echo "No changes to commit"
25+
2426
- name: Push changes
2527
uses: ad-m/github-push-action@master
2628
with:

0 commit comments

Comments
 (0)