Skip to content

Commit 7b163dc

Browse files
committed
feat(button): what sticks
1 parent de2e4c4 commit 7b163dc

File tree

1 file changed

+112
-2
lines changed

1 file changed

+112
-2
lines changed

.github/workflows/make-appsettings-test.yml

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ permissions:
3434
jobs:
3535

3636
make-appsettings:
37-
name: Check solution builds
37+
name: appsettings 1
3838
runs-on: ubuntu-latest
3939
steps:
4040

@@ -84,4 +84,114 @@ jobs:
8484
echo "${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}" > temp_appsettings.json
8585
echo "=== DECODED APPSETTINGS CONTENT ==="
8686
cat temp_appsettings.json
87-
continue-on-error: true
87+
continue-on-error: true
88+
89+
make-appsettings-two:
90+
name: app settings 2
91+
runs-on: ubuntu-latest
92+
steps:
93+
94+
- name: Checkout code
95+
uses: actions/checkout@v3
96+
continue-on-error: true
97+
98+
- name: Debug - Create temporary file with secret content
99+
run: |
100+
# Write the secret to a file
101+
echo '${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}' > temp_secret.json
102+
103+
# Check if file was created and has content
104+
echo "File size: $(wc -c < temp_secret.json) bytes"
105+
106+
# Display file content
107+
echo "File content:"
108+
cat temp_secret.json
109+
110+
# Validate if it's proper JSON
111+
echo "Validating JSON format:"
112+
if cat temp_secret.json | jq . >/dev/null 2>&1; then
113+
echo "✅ Valid JSON"
114+
echo "JSON structure:"
115+
cat temp_secret.json | jq .
116+
else
117+
echo "❌ Not valid JSON"
118+
fi
119+
continue-on-error: true
120+
121+
- name: Create appsettings.Development.json directly
122+
run: |
123+
# Create directory if needed
124+
mkdir -p "$(dirname "./appsettings.Development.json")"
125+
126+
# Write the secret directly to appsettings.Development.json
127+
echo '${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}' > ./appsettings.Development.json
128+
129+
echo "Created appsettings.Development.json"
130+
echo "File size: $(wc -c < ./appsettings.Development.json) bytes"
131+
continue-on-error: true
132+
133+
- name: Verify appsettings.Development.json content
134+
run: |
135+
echo "=== appsettings.Development.json content ==="
136+
cat ./appsettings.Development.json
137+
echo ""
138+
echo "=== End of file ==="
139+
continue-on-error: true
140+
141+
- name: Use secret in script without any processing
142+
run: |
143+
# Important: using single quotes to preserve the exact content
144+
secret_content='${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}'
145+
146+
echo "Secret character count: ${#secret_content}"
147+
148+
# Create a file using the raw secret
149+
echo "$secret_content" > raw_secret.json
150+
151+
echo "First 100 characters of the secret:"
152+
head -c 100 raw_secret.json
153+
echo ""
154+
continue-on-error: true
155+
debug-secret:
156+
name: Debug Secret Value
157+
runs-on: ubuntu-latest
158+
steps:
159+
- name: Direct Echo Secret Value
160+
run: |
161+
echo "Secret value direct echo:"
162+
echo "${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}"
163+
164+
- name: Write to file and display
165+
run: |
166+
# Write to file
167+
echo "${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}" > test_secret.json
168+
169+
# Show file content
170+
echo "File content:"
171+
cat test_secret.json
172+
173+
# Show file stats
174+
echo "File size in bytes: $(wc -c < test_secret.json)"
175+
176+
- name: Test JSON validity
177+
run: |
178+
echo "${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}" > test_json.json
179+
180+
# Try to parse with jq
181+
echo "Parsing with jq:"
182+
cat test_json.json | jq . || echo "Not valid JSON"
183+
184+
- name: Force disable secret filtering
185+
env:
186+
UNFILTERED_SECRET: ${{ secrets.FAKE_WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}
187+
run: |
188+
# Force printing each character
189+
echo "Secret character by character:"
190+
for (( i=0; i<${#UNFILTERED_SECRET}; i++ )); do
191+
echo -n "${UNFILTERED_SECRET:$i:1}"
192+
done
193+
echo ""
194+
195+
# Try with special characters visible
196+
echo "Using cat -A to show special characters:"
197+
echo "$UNFILTERED_SECRET" | cat -A

0 commit comments

Comments
 (0)