fix(deps): update dependency @actions/core to v1.11.1 #202
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: Test and Update dist | |
on: | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Repository | |
uses: actions/checkout@v3 | |
- name: Get Node Version | |
id: node_version | |
run: | | |
node_version=`cat .nvmrc` | |
echo "::set-output name=node_version::$node_version" | |
echo "Node Version: $node_version" | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.node_version.outputs.node_version }} | |
- name: Cache NPM Dependencies | |
id: cache-npm-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Install NPM Dependencies if not cached | |
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true' | |
run: | | |
npm install | |
- name: Build Action | |
run: npm run build | |
- name: Lint Action | |
run: npm run lint | |
- name: Test Action | |
run: npm run test | |
- name: Package Action | |
run: npm run package | |
- name: Commit if dist has changed | |
run: | | |
echo "${{ toJson(github) }}" | |
git config user.name "Github Actions" | |
git config user.email [email protected] | |
if [ $(git status dist --porcelain=v1 2>/dev/null | wc -l) != "0" ]; then | |
git add dist | |
git commit -m "chore: updated dist with new code" | |
git push origin HEAD:${{ github.event.pull_request.head.ref }} --force | |
fi |