-
-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (74 loc) · 2.49 KB
/
workflow.yml
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: "Workflow"
on: # yamllint disable-line rule:truthy
pull_request: null
push:
branches:
- "master"
workflow_call: null
permissions: {} # yamllint disable-line rule:braces
#permissions: "read-all"
#permissions:
# contents: "read" # Private repositories need read permission
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
job_count:
name: "Job count"
runs-on: "ubuntu-22.04"
timeout-minutes: 1
steps:
-
name: "Checkout repository"
uses: "actions/[email protected]"
-
name: "Display total job count"
run: |
Job_count() {
git ls-files --cached -z -- '.github/workflows/*.yml' \
| xargs --null --max-args=1 -- yq '."jobs" | keys | length' \
| paste --serial --delimiters="+" \
| bc
}
printf ':construction_worker: Total number of jobs: %d' \
"$(Job_count)" \
>>"${GITHUB_STEP_SUMMARY}"
run_context:
name: "Run context"
runs-on: "ubuntu-22.04"
timeout-minutes: 1
steps:
-
name: "Dump information about the workflow run"
run: |
printf 'github = '
jq --indent 4 --raw-output --color-output '.' <<"GITHUB__CONTEXT"
${{ toJSON(github) }}
GITHUB__CONTEXT
-
name: "Dump information in dot notation"
run: |
printf 'github = '
jq --indent 4 --raw-output --color-output \
'[paths(scalars) as $p | {"key":$p | join("."), "value":getpath($p)}] | from_entries' \
<<"GITHUB__CONTEXT"
${{ toJSON(github) }}
GITHUB__CONTEXT
actionlint:
name: "Actionlint"
runs-on: "ubuntu-22.04"
timeout-minutes: 1
steps:
-
name: "Checkout repository"
uses: "actions/[email protected]"
-
name: "Set up problem matcher"
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
-
name: "Analyze workflow files"
uses: "docker://rhysd/actionlint:1.7.3"
with:
args: "-color -verbose -shellcheck="