Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit eef5d1b

Browse files
author
Tor Egil Jacobsen
committed
bøgfix workflow
1 parent d05f82a commit eef5d1b

File tree

1 file changed

+38
-17
lines changed

1 file changed

+38
-17
lines changed

.github/workflows/test-maven-setup-action.yaml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,61 @@ jobs:
2323
- run: env | sort
2424
- uses: navikt/bidrag-maven/setup@feature/setup
2525
with:
26-
repositories: maven-releases=http://repo.releases,snapshots=https://repo.snapshots
26+
repositories: maven-releases=https://repo.releases,snapshots=https://repo.snapshots
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
- run: mvn help:effective-pom
3030
- name: Verify .m2 home
3131
run: |
3232
POM=$(cat ~/.m2/settings.xml)
3333
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
4254
fi
4355
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
4660
exit 1
4761
fi
4862
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
5168
fi
5269
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
5574
exit 1
5675
fi
5776
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
6081
exit 1
6182
fi
6283
env:

0 commit comments

Comments
 (0)