Skip to content

Bump @actions/github from 5.1.1 to 6.0.0 (#71) #223

Bump @actions/github from 5.1.1 to 6.0.0 (#71)

Bump @actions/github from 5.1.1 to 6.0.0 (#71) #223

Workflow file for this run

name: tests
on:
push:
branches: [master, main]
tags-ignore: ['**']
paths-ignore: ['**.md']
pull_request:
paths-ignore: ['**.md']
jobs:
gitleaks:
name: 🔐 Check for GitLeaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- uses: gacts/gitleaks@v1
eslint:
name: 🧪 Run ESLint
runs-on: ubuntu-latest
env: {FORCE_COLOR: 'true'}
steps:
- uses: actions/checkout@v4
- uses: gacts/setup-node-with-cache@v1
with: {node-version: 16}
- run: npm ci
- run: npm run lint
tests:
name: 🧪 Run unit tests
runs-on: ubuntu-latest
env: {FORCE_COLOR: 'true'}
steps:
- uses: actions/checkout@v4
- uses: gacts/setup-node-with-cache@v1
with: {node-version: 16}
- run: npm ci
- run: npm run test --verbose
dist-built:
name: 🧪 Check distributive built state
runs-on: ubuntu-latest
outputs:
dist-changed: ${{ steps.state.outputs.changed }}
env: {FORCE_COLOR: 'true'}
steps:
- uses: actions/checkout@v4
- uses: gacts/setup-node-with-cache@v1
with: {node-version: 16}
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v3
with: {name: dist, path: ./dist/, retention-days: 1}
- id: state
run: echo "changed=`git diff --diff-filter=ACMUXTR --name-only | grep dist/ > /dev/null && echo 'true' || echo 'false'`" >> $GITHUB_OUTPUT
commit-and-push-fresh-dist:
name: 🏗️ Commit and push fresh distributive
needs: [dist-built]
if: ${{ needs.dist-built.outputs.dist-changed == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with: {name: dist, path: ./dist/}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automatic distributive rebuild
run-this-action:
name: 🚀 Run action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run this action
uses: ./
id: slug
with:
to-slug: |
foo bar
123
baz !@#^*()_+-=[]{};: blah
- run: if [[ '${{ steps.slug.outputs.is-branch }}' != 'true' ]]; then exit 1; fi
- run: if [[ '${{ steps.slug.outputs.is-tag }}' != 'false' ]]; then exit 1; fi
- run: if [[ '${{ steps.slug.outputs.version-major }}' != 0 ]]; then exit 1; fi
- run: if [[ '${{ steps.slug.outputs.version-minor }}' != 0 ]]; then exit 1; fi
- run: if [[ '${{ steps.slug.outputs.version-patch }}' != 0 ]]; then exit 1; fi
- run: if [[ '${{ steps.slug.outputs.slug }}' != 'foo-bar-123-baz-blah' ]]; then exit 1; fi
- run: if [[ '${{ steps.slug.outputs.commit-hash }}' == '' ]]; then exit 1; fi
- run: if [[ '${{ steps.slug.outputs.commit-hash-short }}' == '' ]]; then exit 1; fi