Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[update] remove ref parameter + fix loading env #13

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pong.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
13 changes: 7 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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