From 5eeb17a9fb0a880879025744688c671a2ccc00b8 Mon Sep 17 00:00:00 2001 From: Evans Mike Date: Tue, 21 Nov 2023 12:44:17 +0000 Subject: [PATCH] action: support client_payload --- .github/workflows/build-singbox-docker.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-singbox-docker.yml b/.github/workflows/build-singbox-docker.yml index e2f38b4..ae653c3 100644 --- a/.github/workflows/build-singbox-docker.yml +++ b/.github/workflows/build-singbox-docker.yml @@ -17,12 +17,17 @@ jobs: buildType: [full] distro: [alpine] runs-on: ubuntu-latest + env: + TAG: ${{ github.event.client_payload.tag || github.event.inputs.tag}} steps: + - name: Get Build Tags + run: | + echo "Version: ${{env.TAG}}" - name: Checkout Source Code of 'SagerNet/sing-box' uses: actions/checkout@v3 with: repository: 'SagerNet/sing-box' - ref: ${{ github.event.inputs.tag }} + ref: ${{env.TAG}} submodules: true - name: Checkout Action Repo uses: actions/checkout@v3 @@ -78,13 +83,13 @@ jobs: if [[ "${{ matrix.distro }}" == "distroless" && "${{ matrix.buildType }}" == "full" ]]; then echo "latest=etnperlong/sing-box:distroless" >> $GITHUB_OUTPUT fi - if [[ -z "${{ github.event.inputs.tag }}" ]]; then + if [[ -z "${{env.TAG}}" ]]; then echo "versioned=etnperlong/sing-box:${{ github.ref_name }}" >> $GITHUB_OUTPUT else if [[ -n "${{ steps.dockerfile.outputs.tagpost }}" ]]; then - echo "versioned=etnperlong/sing-box:${{ github.event.inputs.tag }}-${{ steps.dockerfile.outputs.tagpost }}" >> $GITHUB_OUTPUT + echo "versioned=etnperlong/sing-box:${{env.TAG}}-${{ steps.dockerfile.outputs.tagpost }}" >> $GITHUB_OUTPUT else - echo "versioned=etnperlong/sing-box:${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT + echo "versioned=etnperlong/sing-box:${{env.TAG}}" >> $GITHUB_OUTPUT fi fi - name: Build and release Docker images