actions: add example-tag
This commit is contained in:
parent
f9e93647fb
commit
dcc61603a2
3 changed files with 41 additions and 1 deletions
21
actions/example-tag/.forgejo/workflows/test.yml
Normal file
21
actions/example-tag/.forgejo/workflows/test.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: code.forgejo.org/oci/node:20-bookworm
|
||||
volumes:
|
||||
- /srv/example:/srv/example
|
||||
steps:
|
||||
|
||||
- name: save event
|
||||
run: |
|
||||
d=/srv/example/tag/contexts/$GITHUB_EVENT_NAME
|
||||
mkdir -p $d
|
||||
cat > $d/github <<'EOF'
|
||||
${{ toJSON(github) }}
|
||||
EOF
|
19
actions/example-tag/run.sh
Executable file
19
actions/example-tag/run.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
export d=/srv/example/tag
|
||||
|
||||
function main() {
|
||||
mkdir -p $d
|
||||
|
||||
local repo=root/example-$example
|
||||
|
||||
forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token
|
||||
local sha=$(forgejo-test-helper.sh branch_tip $url $repo main)
|
||||
|
||||
local api=$url/api/v1
|
||||
forgejo-curl.sh api_json --data-raw '{"tag_name":"v1.1","target":"'$sha'"}' $api/repos/$repo/tags
|
||||
|
||||
forgejo-test-helper.sh wait_success $url $repo $sha
|
||||
|
||||
test -f /srv/example/tag/contexts/push/github
|
||||
}
|
||||
|
||||
main
|
|
@ -35,7 +35,7 @@ function examples_v1_20() {
|
|||
|
||||
function examples_v1_21() {
|
||||
# keep "cron" last otherwise it will linger and pollute the following runs
|
||||
echo 'echo push push-cancel artifacts service checkout pull-request container expression local-action context docker-action if if-fail cron'
|
||||
echo 'echo push tag push-cancel artifacts service checkout pull-request container expression local-action context docker-action if if-fail cron'
|
||||
}
|
||||
|
||||
function examples_v1_22() {
|
||||
|
|
Loading…
Add table
Reference in a new issue