Merge pull request #224 from AndreasNel/dependabot/github_actions/hma… #214
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: dist | |
on: | |
push: | |
branches: master | |
paths: | |
- '**.js' | |
- '**.yml' | |
- 'package.json' | |
- '!dist/**' | |
jobs: | |
create-dist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.DIST_TOKEN }} | |
- id: dist | |
name: Check Dist Exists | |
run: | | |
npm i | |
npm run-script package | |
git config user.name "Github Action" | |
git config user.email "action@github.com" | |
echo ::set-output name=filename::$(git diff --name-only dist/index.js) | |
- name: Commit Dist | |
if: steps.dist.outputs.filename == 'dist/index.js' | |
run: git commit -m "Auto-generate dist" -a | |
- name: Push Dist File | |
if: steps.dist.outputs.filename == 'dist/index.js' | |
uses: ad-m/github-push-action@v0.8.0 | |
with: | |
github_token: ${{ secrets.DIST_TOKEN }} |