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

[Feature Request] Support for self-hosted runners, where gh client might not be present #38

Closed
calexandre opened this issue Apr 13, 2022 · 1 comment · Fixed by #39
Closed
Assignees

Comments

@calexandre
Copy link

On a self-hosted runner environment a lot of common tools are not available, such as the gh cli.

One workaround is to ensure an extra action that installs the gh before running the project-beta-automations action, but it would be nice for the action to test if the gh cli is present, and if not, download it from GitHub.

Below is the workaround we implemented in our org to allow the action to run in our self-hosted environment:

jobs:
  issue_opened_or_reopened:
    name: issue_opened_or_reopened
    runs-on: [self-hosted, ubuntu]
    if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened')
    steps:
      - name: Install gh
        run: |
          curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
          echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
          sudo apt update
          sudo apt install gh
      - name: Move issue to Backlog
        uses: leonsteinhaeuser/project-beta-automations@v1.2.1
        with:
          gh_app_secret_key: ${{ secrets.GH_PROJ_AUTOMATION_KEY }}
          gh_app_ID: ${{ secrets.GH_PROJ_AUTOMATION_APP_ID }}
          gh_app_installation_ID: ${{ secrets.GH_PROJ_AUTOMATION_INSTALL_ID }}
          organization: ${{ env.gh_organization }}
          project_id: ${{ env.project_id }}
          resource_node_id: ${{ github.event.issue.node_id }}
          status_value: Backlog
@calexandre calexandre changed the title [Feature Request] Support for self-hosted runners, because gh client is not present [Feature Request] Support for self-hosted runners, where gh client might not be present Apr 13, 2022
@leonsteinhaeuser
Copy link
Owner

@calexandre first of all, thank you for sharing your experience and solution for self-hosted runners. I must honestly admit that I have never tested with self-hosted runners, but it definitely makes sense that this tool is not installed. I will implement this as soon as possible and provide you with a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants