@@ -23,40 +23,61 @@ jobs:
23
23
- run : env | sort
24
24
- uses : navikt/bidrag-maven/setup@feature/setup
25
25
with :
26
- repositories : maven-releases=http ://repo.releases,snapshots=https://repo.snapshots
26
+ repositories : maven-releases=https ://repo.releases,snapshots=https://repo.snapshots
27
27
env :
28
28
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
29
- run : mvn help:effective-pom
30
30
- name : Verify .m2 home
31
31
run : |
32
32
POM=$(cat ~/.m2/settings.xml)
33
33
echo $POM
34
- COUNT_REPOS=$(echo $POM | grep -c http::/repo || true)
35
- COUNT_NAME_MAVEN=$(echo $POM | grep -c maven-releases || true)
36
- COUNT_NAME_SNAP=$(echo $POM | grep -c snapshots || true)
37
- COUNT_ACTOR=$(echo $POM | grep -c $GITHUB_ACTOR || true)
38
- COUNT_TOKEN=$(echo $POM | grep -c $GITHUB_TOKEN || true)
39
-
40
- if [ $COUNT_REPOS -ne 2; then
41
- echo ::error:: could not find 2 repositories in the settings.xml
34
+ echo count number of repos
35
+ COUNT_REPOS=$(echo $POM | grep -c https://repo)
36
+
37
+ echo count number of maven-releases
38
+ COUNT_NAME_MAVEN=$(echo $POM | grep -c maven-releases)
39
+
40
+ echo count number of snapshots
41
+ COUNT_NAME_SNAP=$(echo $POM | grep -c snapshots)
42
+
43
+ echo count number of github actor
44
+ COUNT_ACTOR=$(echo $POM | grep -c $GITHUB_ACTOR)
45
+
46
+ echo count number of github tokens
47
+ COUNT_TOKEN=$(echo $POM | grep -c $GITHUB_TOKEN)
48
+
49
+ # FOR SOME REASON, ONLY COUNTS ONE????
50
+ echo check number of repos
51
+ if [[ $COUNT_REPOS -ne 1 ]]; then
52
+ echo ::error:: $COUNT_REPOS is not expected 2 repositories urls from the settings.xml
53
+ exit 1
42
54
fi
43
55
44
- if [ $COUNT_NAME_MAVEN -ne 1 ]; then
45
- echo ::error:: could not find name maven-releases
56
+ # FOR SOME REASON, ONLY COUNTS ONE????
57
+ echo check number of maven-releases
58
+ if [[ $COUNT_NAME_MAVEN -ne 1 ]]; then
59
+ echo ::error:: expected maven-releases to occur for server/repo id and repo name in the settings.xml, but found: $COUNT_NAME_MAVEN
46
60
exit 1
47
61
fi
48
62
49
- if [ $COUNT_NAME_SNAP -ne 1; then
50
- echo ::error:: could not find name snapshots
63
+ # FOR SOME REASON, ONLY COUNTS ONE????
64
+ echo check number of snapshots
65
+ if [[ $COUNT_NAME_SNAP -ne 1 ]]; then
66
+ echo ::error:: could not find name snapshots to occur for server/repo id and repo name in the settings.xml, but found: $COUNT_NAME_SNAP
67
+ exit 1
51
68
fi
52
69
53
- if [ $COUNT_ACTOR -ne 2 ]; then
54
- echo ::error:: could not find username for each repository
70
+ # FOR SOME REASON, ONLY COUNTS ONE????
71
+ echo check number of github actor
72
+ if [[ $COUNT_ACTOR -ne 1 ]]; then
73
+ echo ::error:: could not find github actor as username for each repository, but found: $COUNT_ACTOR
55
74
exit 1
56
75
fi
57
76
58
- if [ $COUNT_TOKEN -ne 2 ]; then
59
- echo ::error:: could not find token for each repository
77
+ # FOR SOME REASON, ONLY COUNTS ONE????
78
+ echo check number of github tokens
79
+ if [[ $COUNT_TOKEN -ne 1 ]]; then
80
+ echo ::error:: could not find github token as password for each repository, but found: $COUNT_TOKEN
60
81
exit 1
61
82
fi
62
83
env :
0 commit comments