0

EDIT: My repo resides in github enterprise

I have a very basic github workflow action as below: All it does is to run a powershell script as mentioned in here.

name: First Github Action
on:
  workflow_dispatch:

jobs:
  first-job:
    name: First Job
    runs-on: ubuntu-latest
    steps:
      - name: Display the path
        run: echo ${env:PATH}
        shell: pwsh

Unfortunately, it just keeps waiting for the runner to pick up. Below is the message it is being displayed.

Requested labels: ubuntu-latest
Job defined at: {myUserName}/{repoName}/.github/workflows/{myFileName}.yml@refs/heads/main
Waiting for a runner to pick up this job...

EDIT: I created another public repo and ran the action. It is still waiting. enter image description here

enter image description here

Unfortunately, I cannot share my public repo as it is an enterprise github repo owned by the company I work in.

user007
  • 1,504
  • 2
  • 18
  • 51
  • Is the repo private or public? If it's private, you will not be able to run GitHub Actions unless you pay for a license. – tj-cappelletti Jan 27 '23 at 21:17
  • It was initially private. I changed the repository visibility it to public and that didn't make any difference. – user007 Jan 27 '23 at 21:20

1 Answers1

1

Assuming you are running this on GitHub Cloud (or github.com):

  • GitHub Actions is only free for public repositories, otherwise you have to pay for a license
  • Switching the repo's visibility from from private to public may not cause the workflow that is stuck to be picked up. You will likely need to cancel it and queue a new one.
  • Make sure your workflows are located in .github/workflows folder.

Assuming you are running this on GitHub Enterprise Cloud (GHEC):

  • You need to make sure that your admin has Actions enabled
  • You need to make sure that your admin has Actions allowed for repositories not owned by an organization

Assuming you are running this on GitHub Enterprise Server (GHES):

  • You need to make sure that your admin has Actions enabled
  • You need to make sure that your admin has Actions allowed for repositories not owned by an organization
  • You will not be able to use GitHub hosted runners as you have in your YAML file
  • You will need to use a self-hosted runner and your GitHub admin can provide you the details of what you need to use.

The workflow you have in your question does in fact work: https://github.com/tjc-actions-demo/simple-actions

The issue is going to be either permissions related or configuration related. Depending on your environment, you will need to troubleshoot based on my suggestions above.

tj-cappelletti
  • 1,774
  • 12
  • 19
  • I created another public repo in github enterprise. It still does the same thing. Unfortunately, I cannot share the link due to the company policies. Glad, that this is working. I will have to check with my company's enterprise github admin. I wish if I could find what configuration is missing in my repository... – user007 Jan 27 '23 at 21:48
  • If you are running this on GitHub Enterprise then that changes everything. I'll update my answer in a moment. – tj-cappelletti Jan 27 '23 at 21:49
  • 1
    Sorry, I should have mentioned it in my question. I will edit the question for future reference. – user007 Jan 27 '23 at 21:52