From 568ebcffc7541cc0bdfbc773917bb6c62d3bc7e6 Mon Sep 17 00:00:00 2001 From: tiawl Date: Sun, 28 Apr 2024 12:26:57 +0200 Subject: [PATCH] [update] remove ref parameter + fix loading env --- .github/workflows/ping.yml | 1 - .github/workflows/pong.yml | 4 +--- action.yml | 13 +++++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ping.yml b/.github/workflows/ping.yml index 9c40b11..a450bcc 100644 --- a/.github/workflows/ping.yml +++ b/.github/workflows/ping.yml @@ -19,7 +19,6 @@ jobs: - spaceporn runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: tiawl/spaceporn-dep-action-cd-ping@v1 with: repository_name: "${{ github.event.repository.name }}" diff --git a/.github/workflows/pong.yml b/.github/workflows/pong.yml index cc65038..22cc676 100644 --- a/.github/workflows/pong.yml +++ b/.github/workflows/pong.yml @@ -12,12 +12,10 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - token: "${{ secrets.PAT }}" - uses: tiawl/spaceporn-dep-action-cd-pong@v1 if: contains(fromJSON('["spaceporn-dep-action-cd-ping", "spaceporn-dep-action-cd-pong"]'), github.event.client_payload.dependency) with: + repository: "${{ github.repository }}" dependency: "${{ github.event.client_payload.dependency }}" tag: "${{ github.event.client_payload.tag }}" hash: "${{ github.event.client_payload.hash }}" diff --git a/action.yml b/action.yml index f49492b..7935356 100644 --- a/action.yml +++ b/action.yml @@ -5,10 +5,6 @@ inputs: description: 'The repository name' required: false default: "${{ github.action_repository }}" - ref: - description: 'The ref used by the repository' - required: false - default: "${{ github.action_ref }}" runs: using: "composite" steps: @@ -36,11 +32,16 @@ runs: - uses: actions/checkout@v4 with: repository: "${{ inputs.repository }}" - ref: "${{ inputs.ref }}" - name: Load environment env: FILTER: '. | to_entries | map([.key, .value] | join ("=")) | .[]' + REPOSITORY: "${{ inputs.repository }}" shell: bash run: | - yq "${FILTER}" "${GITHUB_ACTION_PATH}/env.yml" >> "${GITHUB_ENV}" + if [[ "${REPOSITORY}" == "${GITHUB_ACTION_REPOSITORY}" ]] + then + yq "${FILTER}" "${GITHUB_ACTION_PATH}/env.yml" >> "${GITHUB_ENV}" + else + yq "${FILTER}" "${GITHUB_WORKSPACE}/env.yml" >> "${GITHUB_ENV}" + fi