gha_config 0.17 → 0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +13 -9
- data/lib/gha_config/config.rb +2 -0
- data/lib/gha_config/parser.rb +1 -0
- data/lib/gha_config/version.rb +1 -1
- data/lib/gha_config/writer.rb +26 -18
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4dedc710facebd9c6ac3826132d29dabfa49304d6bb41ba6e143659611ea6f2f
|
|
4
|
+
data.tar.gz: eebaf08f4252ab8796b005732ed87745e9dea1978ad739fa8a25cd6417a40eed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96212938458677189ca1576df3ec259e917e5b62455bb61c05e95c303588e9a78a69808dd3690fd564779032acf6a42586a4ed98d3adba2b3fed4efaa5aaf291
|
|
7
|
+
data.tar.gz: 156081246d3e7c70254f2ac1fea31006abe69ed0b2f9fea6ccf9ce3b127f2c5eac615f70c323c3401bed3e8942328915977fd24ca36ef8907446c284a1cc098c
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.18] - 2021-08-06
|
|
9
|
+
- Add `_options_` for submodules and SSH.
|
|
10
|
+
|
|
8
11
|
## [0.17] - 2021-08-04
|
|
9
12
|
- Adds submodules to checkout action
|
|
10
13
|
|
data/README.md
CHANGED
|
@@ -131,16 +131,20 @@ Templates get expanded into their contents whenever they are used. Templates can
|
|
|
131
131
|
|
|
132
132
|
If you're using Ruby, you can add this gem to your app Gemfile. Otherwise, you can install it locally. Either way, you can re-run it whenever your "source workflow" changes.
|
|
133
133
|
|
|
134
|
-
###
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
### Special options
|
|
135
|
+
|
|
136
|
+
In addition to `_defaults_`, there are other options that will affect how the output of certain steps is emitted. These options are parsed from the `_options_` key:
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
_options_:
|
|
140
|
+
use_submodules: true
|
|
141
|
+
enable_ssh: true
|
|
142
142
|
```
|
|
143
|
-
|
|
143
|
+
|
|
144
|
+
* `use_submodules`: If this is set it will check out code recursively with submodules. This requires two things:
|
|
145
|
+
* A secret called `FLIPPCIRCLECIPULLER_REPO_TOKEN` - Eng Cap will need to add this
|
|
146
|
+
* Your repo needs to have a Git version > 2.18
|
|
147
|
+
* `enable_ssh`: If set to true, the Flipp global action will have SSH enabled on failures. This should generally only be set to true while debugging things.
|
|
144
148
|
|
|
145
149
|
## Contributing
|
|
146
150
|
|
data/lib/gha_config/config.rb
CHANGED
data/lib/gha_config/parser.rb
CHANGED
|
@@ -6,6 +6,7 @@ module GhaConfig
|
|
|
6
6
|
hash = YAML.safe_load(input)
|
|
7
7
|
config = GhaConfig::Config.new
|
|
8
8
|
config.defaults = hash.delete('_defaults_') || {}
|
|
9
|
+
config.options = hash.delete('_options_') || {}
|
|
9
10
|
config.env = hash.delete('env') || {}
|
|
10
11
|
|
|
11
12
|
hash['jobs'] = replace_defaults(config, hash['jobs'])
|
data/lib/gha_config/version.rb
CHANGED
data/lib/gha_config/writer.rb
CHANGED
|
@@ -35,24 +35,32 @@ module GhaConfig
|
|
|
35
35
|
'runs-on' => '[ubuntu, runner-fleet]'
|
|
36
36
|
}
|
|
37
37
|
job['runs-on'] = '[ubuntu, runner-fleet]'
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
flipp_global = {
|
|
39
|
+
'name' => 'Flipp global',
|
|
40
|
+
'uses' => 'wishabi/github-actions@v0.4',
|
|
41
|
+
'env' => {
|
|
42
|
+
'SLACK_BOT_TOKEN' => "${{ secrets.SLACK_BOT_TOKEN }}"
|
|
43
|
+
},
|
|
44
|
+
'timeout-minutes' => 10,
|
|
45
|
+
'with' => {
|
|
46
|
+
'slack_channel' => '${{env.SLACK_CHANNEL }}',
|
|
47
|
+
'job_status' => '${{ job.status }}'
|
|
48
|
+
}}
|
|
49
|
+
if config.options['enable_ssh']
|
|
50
|
+
flipp_global['env']['enable_ssh'] = true
|
|
51
|
+
end
|
|
52
|
+
job['steps'].unshift(flipp_global)
|
|
53
|
+
checkout = {
|
|
54
|
+
'name' => 'Checkout code',
|
|
55
|
+
'uses' => 'actions/checkout@v2'
|
|
56
|
+
}
|
|
57
|
+
if config.options['use_submodules']
|
|
58
|
+
checkout['with'] = {
|
|
59
|
+
'token' => "${{ secrets.FLIPPCIRCLECIPULLER_REPO_TOKEN || github.token }}",
|
|
60
|
+
'submodules' => 'recursive'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
job['steps'].unshift(checkout)
|
|
56
64
|
job['needs'] = "[#{job['needs'].join(', ')}]" if job['needs'].is_a?(Array)
|
|
57
65
|
new_job.merge!(job)
|
|
58
66
|
output_hash['jobs'][name] = new_job
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gha_config
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.18'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Orner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-08-
|
|
11
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubocop
|