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

support reading from filesystem rather than using the API to fetch configuration file #39

Closed
lrstanley opened this issue Apr 7, 2022 · 0 comments · Fixed by #48
Closed

Comments

@lrstanley
Copy link
Contributor

Looks as though the action is currently hardcoded to use the API to pull the configuration file, as shown below:

issue-labeler/src/main.ts

Lines 133 to 138 in 772f647

const response = await client.repos.getContents({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
path: repoPath,
ref: github.context.sha
});

However, with reusable workflows being a thing, where one might want to centralize some of the common configurations in a .github repository, this doesn't work, unless the config is in the target repo, rather than the reusable repository.

Below is an example workflow, that is a reusable workflow, and it clones my personal lrstanley/.github repository, where most of my triage-related configuration files are stored. I'd like to be able to read from that repo.

name: triage

on: [workflow_call]

jobs:
  issues:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      contents: read
    steps:
      - name: git-clone-tools-repo
        uses: actions/checkout@v3
        with:
          repository: lrstanley/.github
      - name: label-issues
        uses: github/issue-labeler@99b4c5dda477c65f4ef08486b73c5787e1e33601
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
          configuration-path: triage/label-issues.yml
          enable-versioned-regex: 0

Most actions I've used so far (esp. relating to labeling), will read from a local file for the configuration. It would be nice if this action could support first trying to see if $PWD/<configuration-path> exists, and if not, falling back to using the content API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant