mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-12-26 06:42:17 -05:00
do not try to replace SELF if there are not workflows
This commit is contained in:
parent
5e74823706
commit
ed3687d21a
2 changed files with 14 additions and 7 deletions
15
action.yml
15
action.yml
|
@ -5,21 +5,24 @@ description: |
|
|||
|
||||
The forgejo-test-helper.sh script is available to help test and debug actions.
|
||||
|
||||
forgejo=http://root:admin1234@${{ steps.forgejo.outputs.host-port }}
|
||||
`forgejo=http://root:admin1234@${{ steps.forgejo.outputs.host-port }}`
|
||||
|
||||
* forgejo-test-helper.sh push_self_action $forgejo root myaction vTest
|
||||
* `forgejo-test-helper.sh push_self_action $forgejo root myaction vTest`
|
||||
Creates the repository `$forgejo/root/myaction` and populate it with the
|
||||
content of the repository under test, except for the `.forgejo` directory
|
||||
(it would otherwise create an infinite recursion loop). The tag `vTest` is
|
||||
set to the SHA under test.
|
||||
* forgejo-test-helper.sh run_workflow testrepo $forgejo root testrepo myaction
|
||||
* `forgejo-test-helper.sh run_workflow testrepo $forgejo root testrepo myaction`
|
||||
Create the repository `$forgejo/root/testrepo` and populate it with the
|
||||
content of the `testrepo` directory. All occurrences of `SELF` in
|
||||
`testrepo/.forgejo/workflows/*.yml` are replaced with `$forgejo/root/myaction`.
|
||||
* `forgejo-test-helper.sh push testrepo $forgejo root testrepo`
|
||||
Create the repository `$forgejo/root/testrepo` and populate it with the
|
||||
content of the `testrepo` directory.
|
||||
|
||||
This combination allows to run Forgejo Actions workflows from
|
||||
`testrepo` that use the action under test (`myaction`) to verify it
|
||||
works as intended.
|
||||
The combination of `push_self_action` and `run_workflow` allows to
|
||||
run Forgejo Actions workflows from `testrepo` that use the action
|
||||
under test (`myaction`) to verify it works as intended.
|
||||
|
||||
inputs:
|
||||
image:
|
||||
|
|
|
@ -48,7 +48,11 @@ function push() {
|
|||
|
||||
local dir="$DIR/$project"
|
||||
rsync -a $directory/ $dir/
|
||||
sed -i -e "s|SELF|$url/$owner/$self_action|" $dir/.forgejo/workflows/*.yml
|
||||
|
||||
local workflows=$dir/.forgejo/workflows/*.yml
|
||||
if test "$(echo $workflows)" != "$workflows"; then
|
||||
sed -i -e "s|SELF|$url/$owner/$self_action|" $dir/.forgejo/workflows/*.yml
|
||||
fi
|
||||
(
|
||||
cd $dir
|
||||
git init
|
||||
|
|
Loading…
Reference in a new issue