1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-forgejo synced 2024-09-19 09:56:16 +00:00

echo the sha in the output

This commit is contained in:
Earl Warren 2023-03-29 23:33:49 +02:00
parent 62f8a3c3f3
commit 70be187923
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 7 additions and 3 deletions

View file

@ -10,6 +10,7 @@ jobs:
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19
./forgejo-runner.sh setup
export FORGEJO_RUNNER_LOGS=forgejo-runner.log
./forgejo-test-helper.sh run_workflow testdata/demo http://root:admin1234@$(cat forgejo-ip):3000 root demo setup-forgejo
./forgejo-test-helper.sh run_workflow testdata/demo http://root:admin1234@$(cat forgejo-ip):3000 root demo setup-forgejo > /tmp/output
grep '^sha=' /tmp/output
./forgejo-test-helper.sh push_self_action http://root:admin1234@$(cat forgejo-ip):3000 root setup-forgejo vTest
./forgejo-test-helper.sh run_workflow testdata/sanity-checks http://root:admin1234@$(cat forgejo-ip):3000 root sanity-check setup-forgejo

View file

@ -18,7 +18,8 @@ description: |
`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.
content of the `testrepo` directory. The SHA of the tip of the repository
is in the output, starting with `sha=`.
The combination of `push_self_action` and `run_workflow` allows to
run Forgejo Actions workflows from `testrepo` that use the action

View file

@ -63,7 +63,9 @@ function push() {
git commit -m 'initial commit'
git remote add origin $url/$owner/$project
git push --force -u origin main
git rev-parse HEAD > SHA
sha=$(git rev-parse HEAD)
echo $sha > SHA
echo sha=$sha
)
}