actions: use the forgejo context instead of forge and test backward compatibility (#1034)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1034 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
7f6f69c80f
commit
14d2748a33
5 changed files with 28 additions and 8 deletions
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
run: |
|
||||
set -x
|
||||
test $FORGEJO_TOKEN = ${{ env.FORGEJO_TOKEN }}
|
||||
test $FORGEJO_TOKEN = ${{ forge.token }}
|
||||
test $FORGEJO_TOKEN = ${{ forgejo.token }}
|
||||
export DEBIAN_FRONTEND=noninteractive ; apt-get -qq update ; apt-get install -y -qq curl git >& /dev/null
|
||||
curl -sS -o /usr/local/bin/forgejo-curl.sh https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh && chmod +x /usr/local/bin/forgejo-curl.sh
|
||||
forgejo-curl.sh --token "$FORGEJO_TOKEN" login $FORGEJO_SERVER_URL
|
||||
|
|
@ -27,7 +27,7 @@ jobs:
|
|||
- name: determine if the PR is from a fork
|
||||
id: forked
|
||||
run: |
|
||||
if test ${{ forge.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then
|
||||
if test ${{ forgejo.event.pull_request.base.repo.full_name }} = ${{ forge.event.pull_request.head.repo.full_name }} ; then
|
||||
echo value=false >> $FORGEJO_OUTPUT
|
||||
else
|
||||
echo value=true >> $FORGEJO_OUTPUT
|
||||
|
|
@ -95,7 +95,7 @@ jobs:
|
|||
#
|
||||
# create an issue
|
||||
#
|
||||
base_repo=${{ forge.event.pull_request.base.repo.full_name }}
|
||||
base_repo=${{ forgejo.event.pull_request.base.repo.full_name }}
|
||||
forgejo-curl.sh api_json --data-raw '{"title":"ISSUE"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/issues
|
||||
url=$(echo $FORGEJO_SERVER_URL | sed -e "s|://|://$FORGEJO_TOKEN@|")
|
||||
git clone $url/$base_repo base
|
||||
|
|
@ -133,7 +133,7 @@ jobs:
|
|||
|
||||
- name: save event
|
||||
run: |
|
||||
d=/srv/example/pull-request/contexts/${{ forge.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME
|
||||
d=/srv/example/pull-request/contexts/${{ forgejo.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME
|
||||
mkdir -p $d
|
||||
cat > $d/github <<'EOF'
|
||||
${{ toJSON(github) }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue