13
13
# 🖊️ EDIT to change the image registry settings.
14
14
# Registries such as GHCR, Quay.io, and Docker Hub are supported.
15
15
IMAGE_REGISTRY: ${{ " secrets.IMAGE_REGISTRY" | inCurlies }}
16
- {% filter indent (2) % }
16
+ {{ ' ' }} {# Ensure new line for better readability # }
17
17
{%- for var in gitops_variables -%}
18
18
{% include " github-variable.njk" %}
19
19
{%- endfor %}
20
- # Secrets
20
+ # Secrets
21
21
{%- for secret in gitops_secrets -%}
22
22
{% include " github-secret.njk" %}
23
23
{%- endfor %}
24
- {% endfilter %}
25
24
26
25
# 🖊️ EDIT to specify custom tags for the container image, or default tags will be generated below.
27
26
IMAGE_TAGS: ""
@@ -41,97 +40,97 @@ jobs:
41
40
environment: production
42
41
43
42
steps:
44
- - name: Check for required secrets
45
- uses: actions/github-script@v7
46
- with:
47
- script: |
48
- {#-
49
- Perhaps this could use the bash var/secret checker too for consistency
50
- #}
51
- const vars = {
52
- IMAGE_REGISTRY: `${{ " vars.IMAGE_REGISTRY" | inCurlies }} `,
43
+ - name: Check for required secrets
44
+ uses: actions/github-script@v7
45
+ with:
46
+ script: |
47
+ {#-
48
+ Perhaps this could use the bash var/secret checker too for consistency
49
+ #}
50
+ const vars = {
51
+ IMAGE_REGISTRY: `${{ " vars.IMAGE_REGISTRY" | inCurlies }} `,
53
52
{% for var in gitops_variables %}
54
53
{%- if var | eval_if_condition %}
55
54
{%- if var .comment %}
56
- /* {{ var .comment }} */
55
+ /* {{ var .comment }} */
57
56
{%- endif %}
58
- {% if var .commented_out %} /*{% endif %} {{ var .name }} : `${{ (" vars." + var .name ) | inCurlies }} `, {% if var .commented_out %} */{% endif %}
57
+ {% if var .commented_out %} /*{% endif %} {{ var .name }} : `${{ (" vars." + var .name ) | inCurlies }} `,{% if var .commented_out %} */{% endif %}
59
58
{%- endif %}
60
59
{%- endfor %}
61
- };
60
+ };
62
61
63
- const missingVars = Object.entries(vars).filter(([ name, value ]) => {
64
- if (value.length === 0) {
65
- core.error(`Variable "${name}" is not set`);
66
- return true;
67
- }
68
- core.info(`✔️ Variable "${name}" is set`);
69
- return false;
70
- });
62
+ const missingVars = Object.entries(vars).filter(([ name, value ]) => {
63
+ if (value.length === 0) {
64
+ core.error(`Variable "${name}" is not set`);
65
+ return true;
66
+ }
67
+ core.info(`✔️ Variable "${name}" is set`);
68
+ return false;
69
+ });
71
70
72
- const secrets = {
71
+ const secrets = {
73
72
{% for secret in gitops_secrets %}
74
73
{%- if secret | eval_if_condition %}
75
74
{%- if secret .comment %}
76
- /* {{ secret .comment }} */
75
+ /* {{ secret .comment }} */
77
76
{%- endif %}
78
- {% if secret .commented_out %} /*{% endif %} {{ secret .name }} : `${{ (" secrets." + secret .name ) | inCurlies }} `, {% if secret .commented_out %} */{% endif %}
77
+ {% if secret .commented_out %} /*{% endif %} {{ secret .name }} : `${{ (" secrets." + secret .name ) | inCurlies }} `,{% if secret .commented_out %} */{% endif %}
79
78
{%- endif %}
80
79
{%- endfor %}
81
- };
80
+ };
82
81
83
- const missingSecrets = Object.entries(secrets).filter(([ name, value ]) => {
84
- if (value.length === 0) {
85
- core.error(`Secret "${name}" is not set`);
86
- return true;
87
- }
88
- core.info(`✔️ Secret "${name}" is set`);
89
- return false;
90
- });
82
+ const missingSecrets = Object.entries(secrets).filter(([ name, value ]) => {
83
+ if (value.length === 0) {
84
+ core.error(`Secret "${name}" is not set`);
85
+ return true;
86
+ }
87
+ core.info(`✔️ Secret "${name}" is set`);
88
+ return false;
89
+ });
91
90
92
- if (missingVars.length > 0) {
93
- core.error(`❌ At least one required variable is not set in the repository. \n` +
94
- "You can add it using:\n" +
95
- "GitHub UI: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository \n" +
96
- "GitHub CLI: https://cli.github.com/manual/gh_variable_set \n" +
97
- "Also, refer to https://github.com/redhat-actions/oc-login#getting-started-with-the-action-or-see-example");
98
- }
91
+ if (missingVars.length > 0) {
92
+ core.error(`❌ At least one required variable is not set in the repository. \n` +
93
+ "You can add it using:\n" +
94
+ "GitHub UI: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository \n" +
95
+ "GitHub CLI: https://cli.github.com/manual/gh_variable_set \n" +
96
+ "Also, refer to https://github.com/redhat-actions/oc-login#getting-started-with-the-action-or-see-example");
97
+ }
99
98
100
- if (missingSecrets.length > 0) {
101
- core.error(`❌ At least one required secret is not set in the repository. \n` +
102
- "You can add it using:\n" +
103
- "GitHub UI: https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository \n" +
104
- "GitHub CLI: https://cli.github.com/manual/gh_secret_set \n" +
105
- "Also, refer to https://github.com/redhat-actions/oc-login#getting-started-with-the-action-or-see-example");
106
- }
99
+ if (missingSecrets.length > 0) {
100
+ core.error(`❌ At least one required secret is not set in the repository. \n` +
101
+ "You can add it using:\n" +
102
+ "GitHub UI: https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository \n" +
103
+ "GitHub CLI: https://cli.github.com/manual/gh_secret_set \n" +
104
+ "Also, refer to https://github.com/redhat-actions/oc-login#getting-started-with-the-action-or-see-example");
105
+ }
107
106
108
- if (missingVars.length > 0 || missingSecrets.length > 0) {
109
- core.setFailed()
110
- } else {
111
- core.info(`✅ All the required variables and secrets are set`);
112
- }
113
- - name: Check out repository
114
- uses: actions/checkout@v4
115
- with:
116
- fetch-depth: '2'
117
- - name: Pre-init
118
- run: |
119
- buildah --version
120
- syft --version
121
- cosign version
122
- ec version
123
- {# So git doesn't throw "dubious ownership" errors -#}
124
- git config --global --add safe.directory $(pwd)
125
- cat rhtap/env.sh
107
+ if (missingVars.length > 0 || missingSecrets.length > 0) {
108
+ core.setFailed()
109
+ } else {
110
+ core.info(`✅ All the required variables and secrets are set`);
111
+ }
112
+ - name: Check out repository
113
+ uses: actions/checkout@v4
114
+ with:
115
+ fetch-depth: '2'
116
+ - name: Pre-init
117
+ run: |
118
+ buildah --version
119
+ syft --version
120
+ cosign version
121
+ ec version
122
+ {# So git doesn't throw "dubious ownership" errors -#}
123
+ git config --global --add safe.directory $(pwd)
124
+ cat rhtap/env.sh
126
125
127
126
{%- for step in gitops_steps %}
128
- - name: {{ step .name | title }}
129
- run: |
127
+ - name: {{ step .name | title }}
128
+ run: |
130
129
{%- for substep in step .substeps %}
131
- echo "• {{ substep }} "
132
- bash /work/rhtap/{{ substep }} .sh
130
+ echo "• {{ substep }} "
131
+ bash /work/rhtap/{{ substep }} .sh
133
132
{%- endfor -%}
134
133
{%- endfor %}
135
- - name: Done
136
- run: |
137
- echo "Done"
134
+ - name: Done
135
+ run: |
136
+ echo "Done"
0 commit comments