-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (149 loc) · 4.76 KB
/
0init.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# This is a basic workflow to help you get started with Actions
name: 0 start
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '*/23 */7 * * *'
push:
branches: [ main ]
#pull_request:
# branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: false
default: 'warning'
type: choice
options:
- info
- warning
- debug
print_tags:
description: 'True to print to STDOUT'
required: false
type: boolean
username:
description: '実行者'
default: '-'
required: false
type: string
tags:
description: 'Test scenario tags'
required: false
type: string
environment:
description: 'Environment to run tests against'
type: environment
required: false
node-version:
description: 'node-version'
required: true
default: '16'
type: choice
options:
- "12"
- "14"
- "16"
outputs:
random-number:
description: "Random number"
value: 3
env:
current_date: "123456789"
jobs:
maketime:
name: maketime
timeout-minutes: 15
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.step1.outputs.test }}
output2: ${{ steps.step2.outputs.current_datetime }}
output3: ${{ steps.step3.outputs.step3_output}}
steps:
- id: step1
run: |
echo ${CURRENT_DATETIME} ${current_date}
echo "(1) ths is env=$ENV_1"
echo "ENV_1=ENV_3" >> $GITHUB_ENV
echo "::set-output name=test::${current_date}"
- id: step2
name: Set current datetime as env variable
run: |
echo "(2) ths is env=$ENV_1"
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
echo "::set-output name=current_datetime::$(date +'%Y%m%d%H%M%S')"
- id: step3
name: show time 2
run: |
echo "(2) ths is env=$ENV_1"
echo ${CURRENT_DATETIME} ${current_date}
echo "::set-output name=step3_output::'step3_output'"
release:
needs: maketime
runs-on: ubuntu-latest
steps:
- name: show time on release step
run: |
echo "maketimeで作った時間n1: ${{needs.maketime.outputs.output1}}"
echo "maketimeで作った時間n2: ${{needs.maketime.outputs.output2}}"
echo "maketimeで作った時間n3: ${{needs.maketime.outputs.output3}}"
echo ${current_date}
echo "(2) ths is env=$ENV_1"
- name: show github env
run: echo ${{github.env}}
- id: random-number-generator
run: echo "::set-output name=random-id::$(echo $RANDOM)"
shell: bash
- id: run-at-main-branche
if: github.ref == 'refs/heads/main'
run: echo "::set-output name=random-id::$(echo $RANDOM)"
shell: bash
- uses: actions/checkout@v3
with:
node-version: ${{ matrix.node }}
persist-credentials: true
ref: ${{ github.head_ref }}
fetch-depth: 0
- run: |
set -x
assets=()
for asset in ./*.md; do
assets+=("-a" "$asset")
done
echo "maketimeで作った時間1: ${{needs.maketime.outputs.output1}}"
echo "maketimeで作った時間2: ${{needs.maketime.outputs.output2}}"
echo ${{needs.maketime.outputs.output2}}
echo "maketimeで作った時間3: ${{needs.maketime.outputs.output3}}"
echo ${{needs.maketime.outputs.output1}}
tag_name="${{ steps.step1.outputs.test }}${GITHUB_REF##*/}"
tag_name2="${{needs.maketime.outputs.output2}}${GITHUB_REF##*/}"
hub release create "${assets[@]}" -pm "$tag_name" "$tag_name2"
echo "::group::My title"
echo "::workflow-command parameter1={data},parameter2={data}::{command value}"
echo "::endgroup::"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# blankに内包した
# call-workflow-gh-command:
# needs: maketime
# uses: ./.github/workflows/4 ghcommand.yml
# with:
# datetime: ${{needs.maketime.outputs.output2}}
call1-passing-data:
needs: [ release ]
uses: ./.github/workflows/1print-tag.yml
call2-create-branch:
needs: maketime
uses: ./.github/workflows/2create_branch.yml
with:
datetime: ${{needs.maketime.outputs.output2}}
token: ${{ github.event.secrets.token }}
call3-commit-data:
needs: maketime
uses: ./.github/workflows/3 add_commit.yml
with:
datetime: ${{needs.maketime.outputs.output2}}