mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-27 08:40:57 -05:00
documentation and sanity check for tokens
This commit is contained in:
parent
b9dd7fd700
commit
42078f52f6
2 changed files with 7 additions and 5 deletions
|
@ -8,20 +8,17 @@ Setup Forgejo and a runner.
|
|||
The forgejo-test-helper.sh script is available to help test and debug actions.
|
||||
|
||||
`forgejo=http://root:admin1234@${{ steps.forgejo.outputs.host-port }}`
|
||||
`token=${{ steps.forgejo.outputs.token }}`
|
||||
|
||||
* `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 $token`
|
||||
* `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`.
|
||||
All occurrences of `FORGEJO_TOKEN` `testrepo/.forgejo/workflows/*.yml`
|
||||
are replaced with `$token`.
|
||||
* `forgejo-test-helper.sh push testrepo $forgejo root testrepo $token`
|
||||
* `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. The SHA of the tip of the repository
|
||||
is in the output, starting with `sha=`.
|
||||
|
|
|
@ -47,6 +47,11 @@ function push() {
|
|||
local self_action="$5"
|
||||
local token="$6"
|
||||
|
||||
if test -z "$token"; then
|
||||
echo missing token argument
|
||||
return 1
|
||||
fi
|
||||
|
||||
local dir="$DIR/$project"
|
||||
rsync -a $directory/ $dir/
|
||||
|
||||
|
|
Loading…
Reference in a new issue