You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to encapsulate the config file with my own shared action that calls your action. My shared action includes my config file that is passes to your action. That way, multiple repos can call my shared action to check PR title consistently.
For this, I would like my action to call your action like this:
name: Check PR title
description: Check that the PR title conforms to the Contribution Guidelines embedded in this action.
runs:
using: composite
steps:
- uses: thehanimo/[email protected]
with:
GITHUB_TOKEN: ${{ github.token }}
local_configuration_path: ${{ github.action_path }}/pr-title-checker-config.json
where pr-title-checker-config.json is in the same location as my action.yaml. The action thehanimo/pr-title-checker seems to prefix the local_configuration_path with the path to the folder of the workflow calling my shared action. The output is:
Using local config file /home/runner/_work/_actions/<ActionOwner>/<ActionRepo>/<GitRef>/.github/actions/pr-title-check/pr-title-checker-config.json
Error: Couldn't retrieve or parse the config file specified - Error: ENOENT: no such file or directory, open
'/home/runner/_work/<WorkflowRepo>/<WorkflowRepo>/home/runner/_work/_actions/<ActionOwner>/<ActionRepo>/<GitRef>/.github/actions/pr-title-check/pr-title-checker-config.json'
The text was updated successfully, but these errors were encountered:
GMZwinge
changed the title
local_configuration_path adds pwd to absolute path
local_configuration_path insert current working directory before absolute path
Feb 28, 2024
Just to make sure I understand this correctly, the config file you want to use does not live in the repo that calls the action, correct? The repo calls your action, whose repo contains the config? How about using a remote config link or a GitHub repo config if it is private?
@thehanimo That is correct. The repo of the workflow that calls my action does not contain the config file. The config file lives in the repo containing my called action that calls your action. A remote config link or a GitHub repo config would probably works, but it's more complicated and it defeats the purpose of ${{ github.action_path }} that can be used to access files located in the same repository as the action according to github.action_path in github context.
To not break backward compatibility, there could be a new input named for example absolute_configuration_path that to handle the use of ${{ github.action_path }}.
I am trying to encapsulate the config file with my own shared action that calls your action. My shared action includes my config file that is passes to your action. That way, multiple repos can call my shared action to check PR title consistently.
For this, I would like my action to call your action like this:
where
pr-title-checker-config.json
is in the same location as myaction.yaml
. The actionthehanimo/pr-title-checker
seems to prefix thelocal_configuration_path
with the path to the folder of the workflow calling my shared action. The output is:The workaround is to use this:
The text was updated successfully, but these errors were encountered: