-
-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (61 loc) · 1.96 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
# 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 -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
actionlint:
name: "Actionlint"
runs-on: "ubuntu-22.04"
timeout-minutes: 1
steps:
-
name: "Checkout repository"
uses: "actions/[email protected]"
-
name: "Analyze workflow files"
uses: "docker://rhysd/actionlint:1.6.25"
with:
args: "-color -verbose -shellcheck="