Repository navigation
73 lines (66 loc) · 2.55 KB
/
Copy pathsettings-interactive-mode.yml
File metadata and controls
73 lines (66 loc) · 2.55 KB
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
name: settings.xml interactiveMode=false (#1052)
# The action generates ~/.m2/settings.xml. After v5.4.0 it now emits
# <interactiveMode>false</interactiveMode> so Maven never blocks on prompts in CI.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
interactive-mode-baseline:
name: 'BASELINE v5.4.0: settings.xml has NO interactiveMode - ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Set up Java with published v5.4.0 (generates settings.xml)
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 (published)
with:
distribution: temurin
java-version: '21'
- name: Assert interactiveMode is absent in settings.xml (previous behavior)
shell: bash
run: |
set -euo pipefail
SETTINGS="$HOME/.m2/settings.xml"
echo "Reading $SETTINGS"
test -f "$SETTINGS" || { echo "::error::settings.xml not found"; exit 1; }
cat "$SETTINGS"
if tr -d '[:space:]' < "$SETTINGS" | grep -q "<interactiveMode>"; then
echo "::error::v5.4.0 unexpectedly wrote an interactiveMode element"
exit 1
fi
echo "OK (baseline): no interactiveMode element, as expected for v5.4.0"
interactive-mode:
name: 'CURRENT: settings.xml has interactiveMode=false - ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Set up Java (generates settings.xml)
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: temurin
java-version: '21'
# server-id defaults to "github", so settings.xml is generated.
- name: Assert interactiveMode=false in settings.xml
shell: bash
run: |
set -euo pipefail
SETTINGS="$HOME/.m2/settings.xml"
echo "Reading $SETTINGS"
test -f "$SETTINGS" || { echo "::error::settings.xml not found"; exit 1; }
cat "$SETTINGS"
# Normalize whitespace and look for the element.
if tr -d '[:space:]' < "$SETTINGS" | grep -q "<interactiveMode>false</interactiveMode>"; then
echo "OK: interactiveMode=false present"
else
echo "::error::interactiveMode=false not found in settings.xml"
exit 1
fi