Repository navigation
92 lines (81 loc) 路 2.92 KB
/
Copy pathtest.yml
File metadata and controls
92 lines (81 loc) 路 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
# docs: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: 馃И Tests
on:
push:
branches: [master, main]
tags-ignore: ['**']
paths-ignore: ['**.md']
pull_request:
paths-ignore: ['**.md']
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env: {FORCE_COLOR: 'true'}
jobs:
gitleaks:
name: Check for GitLeaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with: {fetch-depth: 0}
- uses: gacts/gitleaks@v1
eslint:
name: Run code linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with: {node-version-file: ./package.json, cache: 'npm'}
- run: npm install
- run: npm run lint
dist-built:
name: Check distributive built state
runs-on: ubuntu-latest
outputs:
dist-changed: ${{ steps.state.outputs.changed }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with: {node-version-file: ./package.json, cache: 'npm'}
- run: npm install
- run: npm run build
- uses: actions/upload-artifact@v7
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@v7
- uses: actions/download-artifact@v8
with: {name: dist, path: ./dist/}
- uses: stefanzweifel/git-auto-commit-action@v7
with: {commit_message: Automatic distributive rebuild}
run-this-action:
name: Run this action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- 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