From b67f9e1a70c4d230be37cc367ed19029bcd87e8b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 9 Jul 2025 14:09:48 +0000 Subject: [PATCH] chore: s/GITHUB_*/FORGEJO_*/ & s/github./forge./ (#776) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/776 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/end-to-end.yml | 6 +-- .../example-cron/.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/test.yml | 2 +- .../example-if/.forgejo/workflows/test.yml | 2 +- .../.forgejo/local-action/action.yml | 8 +-- .../.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/test.yml | 50 +++++++++---------- .../example-push/.forgejo/workflows/test.yml | 2 +- .../example-tag/.forgejo/workflows/test.yml | 2 +- .../.forgejo/workflows/test.yml | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.forgejo/workflows/end-to-end.yml b/.forgejo/workflows/end-to-end.yml index d535d37d..28b9cd49 100644 --- a/.forgejo/workflows/end-to-end.yml +++ b/.forgejo/workflows/end-to-end.yml @@ -128,13 +128,13 @@ jobs: run: | set -x full_version=$(./end-to-end.sh full_version ${{ matrix.info.version }} ${{ matrix.info.owner }}) - echo value="$full_version" >> $GITHUB_OUTPUT + echo value="$full_version" >> $FORGEJO_OUTPUT - run: ./end-to-end.sh prepare_dockerd - run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}" - name: update documentation uses: https://data.forgejo.org/actions/cascading-pr@v2.1 with: - origin-url: ${{ env.GITHUB_SERVER_URL }} + origin-url: ${{ env.FORGEJO_SERVER_URL }} origin-repo: ${{ forge.repository }} origin-token: ${{ secrets.CASCADE_DOCS_ORIGIN_TOKEN }} origin-ref: refs/heads/main @@ -143,7 +143,7 @@ jobs: destination-repo: forgejo/docs destination-branch: ${{ matrix.info.branch || format('v{0}', matrix.info.version) }} destination-token: ${{ secrets.CASCADE_DOCS_DESTINATION_TOKEN }} - prefix: ${{ env.GITHUB_REPOSITORY }}-${{ matrix.info.version }} + prefix: ${{ env.FORGEJO_REPOSITORY }}-${{ matrix.info.version }} update: .forgejo/cascading-docs env: FORCE_VERSION: "${{ vars.CASCADE_DOCS_FORCE_VERSION }}" diff --git a/actions/example-cron/.forgejo/workflows/test.yml b/actions/example-cron/.forgejo/workflows/test.yml index e2748f8a..054ddad6 100644 --- a/actions/example-cron/.forgejo/workflows/test.yml +++ b/actions/example-cron/.forgejo/workflows/test.yml @@ -12,7 +12,7 @@ jobs: steps: - name: save context run: | - d=/srv/example/cron/contexts/$GITHUB_EVENT_NAME + d=/srv/example/cron/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-expression/.forgejo/workflows/test.yml b/actions/example-expression/.forgejo/workflows/test.yml index e20a996a..ba37759e 100644 --- a/actions/example-expression/.forgejo/workflows/test.yml +++ b/actions/example-expression/.forgejo/workflows/test.yml @@ -23,7 +23,7 @@ jobs: if: ${{ env.KEY1 == 'nogood' }} - name: if does not skip id: conditional - run: echo 'check=good' >> $GITHUB_OUTPUT + run: echo 'check=good' >> $FORGEJO_OUTPUT if: env.KEY1 == 'value1' - name: verify if did not skip run: test ${{ steps.conditional.outputs.check }} = good diff --git a/actions/example-if/.forgejo/workflows/test.yml b/actions/example-if/.forgejo/workflows/test.yml index cc9401ce..355d9f20 100644 --- a/actions/example-if/.forgejo/workflows/test.yml +++ b/actions/example-if/.forgejo/workflows/test.yml @@ -8,7 +8,7 @@ jobs: - name: if true if: true id: if_true - run: echo 'check=good' >> $GITHUB_OUTPUT + run: echo 'check=good' >> $FORGEJO_OUTPUT - name: verify if true was run run: test ${{ steps.if_true.outputs.check }} = good diff --git a/actions/example-local-action/.forgejo/local-action/action.yml b/actions/example-local-action/.forgejo/local-action/action.yml index 79637578..6f5df8e1 100644 --- a/actions/example-local-action/.forgejo/local-action/action.yml +++ b/actions/example-local-action/.forgejo/local-action/action.yml @@ -13,10 +13,10 @@ outputs: runs: using: "composite" steps: - - name: GITHUB_ACTION_PATH + - name: FORGEJO_ACTION_PATH run: | set -x - test "$(basename $GITHUB_ACTION_PATH)" = local-action - test "$GITHUB_ACTION_PATH" = "${{ env.GITHUB_ACTION_PATH }}" + test "$(basename $FORGEJO_ACTION_PATH)" = local-action + test "$FORGEJO_ACTION_PATH" = "${{ env.FORGEJO_ACTION_PATH }}" - - run: echo key=${{ inputs.input-two-required }} >> $GITHUB_OUTPUT + - run: echo key=${{ inputs.input-two-required }} >> $FORGEJO_OUTPUT diff --git a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml index 135364aa..73e9b404 100644 --- a/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml +++ b/actions/example-post-7-0-schedule/.forgejo/workflows/test.yml @@ -12,7 +12,7 @@ jobs: steps: - name: save context run: | - d=/srv/example/post-7-0-schedule/contexts/$GITHUB_EVENT_NAME + d=/srv/example/post-7-0-schedule/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-pull-request/.forgejo/workflows/test.yml b/actions/example-pull-request/.forgejo/workflows/test.yml index 2b864cb6..320d0a86 100644 --- a/actions/example-pull-request/.forgejo/workflows/test.yml +++ b/actions/example-pull-request/.forgejo/workflows/test.yml @@ -17,45 +17,45 @@ jobs: shell: bash run: | set -x - test $GITHUB_TOKEN = ${{ env.GITHUB_TOKEN }} - test $GITHUB_TOKEN = ${{ forge.token }} + test $FORGEJO_TOKEN = ${{ env.FORGEJO_TOKEN }} + test $FORGEJO_TOKEN = ${{ forge.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 "$GITHUB_TOKEN" login $GITHUB_SERVER_URL - forgejo-curl.sh api_json $GITHUB_SERVER_URL/api/v1/user + forgejo-curl.sh --token "$FORGEJO_TOKEN" login $FORGEJO_SERVER_URL + forgejo-curl.sh api_json $FORGEJO_SERVER_URL/api/v1/user - 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 - echo value=false >> $GITHUB_OUTPUT + echo value=false >> $FORGEJO_OUTPUT else - echo value=true >> $GITHUB_OUTPUT + echo value=true >> $FORGEJO_OUTPUT fi # See also actions/example-context/.forgejo/workflows/test.yml - - name: env.GITHUB_BASE_REF + - name: env.FORGEJO_BASE_REF run: | set -x - test "$GITHUB_BASE_REF" = main - test "$GITHUB_BASE_REF" = "${{ env.GITHUB_BASE_REF }}" + test "$FORGEJO_BASE_REF" = main + test "$FORGEJO_BASE_REF" = "${{ env.FORGEJO_BASE_REF }}" # See also actions/example-context/.forgejo/workflows/test.yml - - name: env.GITHUB_HEAD_REF + - name: env.FORGEJO_HEAD_REF run: | set -x if ${{ steps.forked.outputs.value }} ; then - test "$GITHUB_HEAD_REF" = main + test "$FORGEJO_HEAD_REF" = main else - test "$GITHUB_HEAD_REF" = other + test "$FORGEJO_HEAD_REF" = other fi - test "$GITHUB_HEAD_REF" = "${{ env.GITHUB_HEAD_REF }}" + test "$FORGEJO_HEAD_REF" = "${{ env.FORGEJO_HEAD_REF }}" - name: secrets shell: bash run: | set -x - case $GITHUB_EVENT_NAME in + case $FORGEJO_EVENT_NAME in pull_request_target) # # all PRs: secrets @@ -76,7 +76,7 @@ jobs: fi ;; *) - echo unexpected event $GITHUB_EVENT_NAME + echo unexpected event $FORGEJO_EVENT_NAME false ;; esac @@ -96,8 +96,8 @@ jobs: # create an issue # base_repo=${{ forge.event.pull_request.base.repo.full_name }} - forgejo-curl.sh api_json --data-raw '{"title":"ISSUE"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/issues - url=$(echo $GITHUB_SERVER_URL | sed -e "s|://|://$GITHUB_TOKEN@|") + 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 branch=B$RANDOM ( @@ -108,7 +108,7 @@ jobs: echo CHANGE >> README git add . git commit -m 'change' - case $GITHUB_EVENT_NAME in + case $FORGEJO_EVENT_NAME in pull_request_target|pull_request) # # repository write scope via http git passthrough @@ -117,15 +117,15 @@ jobs: # # repository write scope via the API # - assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"title":"PR","base":"main","head":"'$branch'"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/pulls - assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"color":"#ffffff","name":"labelname"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/labels + assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"title":"PR","base":"main","head":"'$branch'"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/pulls + assert_fail_if_forked forgejo-curl.sh api_json --data-raw '{"color":"#ffffff","name":"labelname"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/labels # # See https://codeberg.org/forgejo/forgejo/issues/1525 # - ! forgejo-curl.sh api_json --data-raw '{"new_branch_name":"B'$RANDOM'"}' $GITHUB_SERVER_URL/api/v1/repos/$base_repo/branches + ! forgejo-curl.sh api_json --data-raw '{"new_branch_name":"B'$RANDOM'"}' $FORGEJO_SERVER_URL/api/v1/repos/$base_repo/branches ;; *) - echo unexpected event $GITHUB_EVENT_NAME + echo unexpected event $FORGEJO_EVENT_NAME false ;; esac @@ -133,7 +133,7 @@ jobs: - name: save event run: | - d=/srv/example/pull-request/contexts/${{ forge.event.pull_request.head.repo.owner.username }}/$GITHUB_EVENT_NAME + d=/srv/example/pull-request/contexts/${{ forge.event.pull_request.head.repo.owner.username }}/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} @@ -143,7 +143,7 @@ jobs: - name: checkout the default branch if pull_request_target run: | set -x - case $GITHUB_EVENT_NAME in + case $FORGEJO_EVENT_NAME in pull_request_target) ! test -f file-unique-to-the-pr-branch ;; @@ -151,7 +151,7 @@ jobs: test -f file-unique-to-the-pr-branch ;; *) - echo unexpected event $GITHUB_EVENT_NAME + echo unexpected event $FORGEJO_EVENT_NAME false ;; esac diff --git a/actions/example-push/.forgejo/workflows/test.yml b/actions/example-push/.forgejo/workflows/test.yml index 89763f29..6075b1a2 100644 --- a/actions/example-push/.forgejo/workflows/test.yml +++ b/actions/example-push/.forgejo/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: save event run: | - d=/srv/example/push/contexts/$GITHUB_EVENT_NAME + d=/srv/example/push/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-tag/.forgejo/workflows/test.yml b/actions/example-tag/.forgejo/workflows/test.yml index c7e13570..ddc673e0 100644 --- a/actions/example-tag/.forgejo/workflows/test.yml +++ b/actions/example-tag/.forgejo/workflows/test.yml @@ -14,7 +14,7 @@ jobs: - name: save event run: | - d=/srv/example/tag/contexts/$GITHUB_EVENT_NAME + d=/srv/example/tag/contexts/$FORGEJO_EVENT_NAME mkdir -p $d cat > $d/github <<'EOF' ${{ toJSON(github) }} diff --git a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml index 186fe563..c2dcea6d 100644 --- a/actions/example-workflow-dispatch/.forgejo/workflows/test.yml +++ b/actions/example-workflow-dispatch/.forgejo/workflows/test.yml @@ -50,7 +50,7 @@ jobs: steps: - name: save and display context run: | - d=/srv/example/workflow-dispatch/contexts/$GITHUB_EVENT_NAME + d=/srv/example/workflow-dispatch/contexts/$FORGEJO_EVENT_NAME mkdir -p $d tee $d/github <<'EOF' ${{ toJSON(github) }}