|
14 | 14 | dir="$(dirname "$0")" |
15 | 15 |
|
16 | 16 | gitactionDir=.github |
17 | | -gitactionConfig=$gitactionDir/workflows/.gitaction.yml |
| 17 | +gitactionConfigRoot=/workflows/.gitaction.yml |
| 18 | +gitactionConfig=$gitactionDir$gitactionConfigRoot |
18 | 19 | gitactionBuildScript=$gitactionDir/build.sh |
19 | 20 | gitactionSettingsFile=$gitactionDir/settings.xml |
20 | 21 | gitactionNotifyScript=$gitactionDir/notify.sh |
@@ -108,9 +109,8 @@ process() { |
108 | 109 |
|
109 | 110 | # Change pom.xml from Travis CI to GitHub Action |
110 | 111 | domain="github.com" |
111 | | - domain=$(grep "travis-ci\.[a-z]*/$repoSlug" pom.xml 2>/dev/null | sed 's/.*\(travis-ci\.[a-z]*\).*/\1/') |
112 | | - grep "Travis CI" pom.xml 2>/dev/null | sed 's/Travis CI/GitHub Actions/' |
113 | | - grep "travis-ci\.[a-z]*/$repoSlug" pom.xml | sed '/travis-ci/c\<url>https://github.com/$repoSlug/actions<\/url>' |
| 112 | + sed -i 's/Travis CI/GitHub Actions/g' pom.xml |
| 113 | + sed -i "s/travis-ci.*/github.com\/$repoSlug\/actions\/workflows\/\.gitaction\.yml<\/url>/g" pom.xml |
114 | 114 |
|
115 | 115 | # -- GitHub Action sanity checks -- |
116 | 116 |
|
@@ -214,14 +214,14 @@ EOL |
214 | 214 |
|
215 | 215 | # update the README |
216 | 216 | # https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge |
217 | | - if grep -q "github\.com/[a-zA-Z0-9/_-]*/actions/workflow/main.yml/badge.svg" README.md >/dev/null 2>&1 |
| 217 | + if grep -q "travis-ci.*svg" README.md >/dev/null 2>&1 |
218 | 218 | then |
219 | 219 | info "Updating README.md GitHub Action badge" |
220 | | - sed "s|github\.com\/[a-zA-Z0-9/_-]*|$domain/$repoSlug|g" README.md >"$tmpFile" |
| 220 | + sed "s/travis-ci.*/${domain//\//\\/}\/${repoSlug//\//\\/}\/actions${gitactionConfigRoot//\//\\/}\/badge\.svg\)\]\(https:\/\/$domain\/${repoSlug//\//\\/}\/actions${gitactionConfigRoot//\//\\/}\)/g" README.md >"$tmpFile" |
221 | 221 | update README.md 'GitHub Action: fix README.md badge link' |
222 | 222 | else |
223 | 223 | info "Adding GitHub Action badge to README.md" |
224 | | - echo "[](https://$domain/$repoSlug)" >"$tmpFile" |
| 224 | + echo "[](https://$domain/$repoSlug/actions/$gitactionConfig)/g" README.md >"$tmpFile" |
225 | 225 | echo >>"$tmpFile" |
226 | 226 | test -f README.md && cat README.md >>"$tmpFile" |
227 | 227 | update README.md 'GitHub Action: add badge to README.md' |
|
0 commit comments