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

uses: keyword is not currently supported #33

Open
james-s-w-clark opened this issue Feb 15, 2023 · 8 comments
Open

uses: keyword is not currently supported #33

james-s-w-clark opened this issue Feb 15, 2023 · 8 comments
Labels
documentation Improvements or additions to documentation

Comments

@james-s-w-clark
Copy link

james-s-w-clark commented Feb 15, 2023

I have googled around the error uses: keyword is not currently supported, but couldn't figure out how to fix this issue (other actions are working fine, and they use uses). It's the first time I've seen this, so I thought I'd raise an issue here.

I can see that the Action works nice for public repos:

https://github.com/rossjrw/pr-preview-action/tree/gh-pages/pr-preview/pr-8
#8

I'm trying this in GitHub Enterprise on a self-hosted runner, but it fails with a really weird error.

Action run logs

2023-02-14T18:56:00.7683072Z Found online and idle self-hosted runner(s) in the current repository's organization/enterprise account that matches the required labels: 'self-hosted'
2023-02-14T18:56:00.7683941Z Waiting for a self-hosted runner to pick up this job...
2023-02-14T18:56:10.0154451Z Current runner version: '2.302.0'
2023-02-14T18:56:10.0162322Z Runner name: 'my-runner'
2023-02-14T18:56:10.0162762Z Runner group name: 'Default'
2023-02-14T18:56:10.0163385Z Machine name: 'abc123def'
2023-02-14T18:56:10.0165051Z ##[group]GITHUB_TOKEN Permissions
2023-02-14T18:56:10.0165679Z Actions: write
2023-02-14T18:56:10.0165898Z Checks: write
2023-02-14T18:56:10.0166176Z Contents: write
2023-02-14T18:56:10.0166437Z Deployments: write
2023-02-14T18:56:10.0166676Z Discussions: write
2023-02-14T18:56:10.0166887Z Issues: write
2023-02-14T18:56:10.0167107Z Metadata: read
2023-02-14T18:56:10.0167320Z Packages: write
2023-02-14T18:56:10.0167539Z PullRequests: write
2023-02-14T18:56:10.0167798Z RepositoryProjects: write
2023-02-14T18:56:10.0168015Z SecurityEvents: write
2023-02-14T18:56:10.0168300Z Statuses: write
2023-02-14T18:56:10.0168521Z ##[endgroup]
2023-02-14T18:56:10.0172360Z Prepare workflow directory
2023-02-14T18:56:10.1738386Z Prepare all required actions
2023-02-14T18:56:10.2070688Z Getting action download info
2023-02-14T18:56:16.5313348Z Download action repository 'actions/checkout@v3' (SHA:ac593985615ec2ede58e132d2e21d2b1cbd6127c)
2023-02-14T18:56:16.8288999Z Download action repository 'rossjrw/pr-preview-action@v1' (SHA:eac2838daf487e8f054a4bc10dc957431cd6270b)
2023-02-14T18:56:17.2948704Z ##[error]`uses:` keyword is not currently supported.

Workflow yaml

Indentaiton may be off due to copy paste, but here is the action - pretty much the same as an example from the readme:

name: Deploy PR previews
concurrency: preview-${{ github.ref }}
 
on:
  pull_request:
    types:
    - opened
    - reopened
    - synchronize
    - closed
jobs:
  deploy-preview:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v3
      - run: yarn install && yarn build
      - uses: rossjrw/pr-preview-action@v1

If I remove - uses: rossjrw/pr-preview-action@v1, the logs manage to checkout and then try and install yarn etc.
So, it seems like it gets confused on the very last line.

@rossjrw
Copy link
Owner

rossjrw commented Feb 15, 2023

That's... really odd. I'm sorry, I've never seen this happen before.

I wonder if it's to do with how the action is set up. actions/checkout runs entirely out of a JS script:

https://github.com/actions/checkout/blob/ac593985615ec2ede58e132d2e21d2b1cbd6127c/action.yml#L77-L80

But pr-preview-action it itself composed of sub-actions:

- name: Deploy preview directory
if: env.action == 'deploy'
uses: JamesIves/github-pages-deploy-action@v4
with:

I'm seeing some discussion in a PR on actions/runner about this - there's a very familiar error log at the bottom: actions/runner#612

If I had to guess, I'd guess that the official GitHub runners have some flag set on them that is allowing them to run nested composite actions, but your self-hosted runner doesn't. I'm genuinely unsure what can be done about that, sorry.

Other than filing a bug report with actions/runner, the only advice I can give you is to consider another solution. If you need to stick with cloud services, perhaps Vercel/Netlify? Or alternatively you could copy and amend the procedure from this action (https://github.com/rossjrw/pr-preview-action/blob/main/action.yml) and retrofit it directly into your workflow. I can't guarantee you won't hit the same error somewhere else, but it might help.

@james-s-w-clark
Copy link
Author

Hey Ross,

Good find with that link. This morning it clicked that you have some nested actions (I saw them at https://github.com/rossjrw/pr-preview-action#acknowledgements), and that I saw some stuff about composite. I tried tacking on some composite stuff to our Action, but I think that was the wrong place for it anyway.

I've just seen your's is marked with composite, in the last link you sent: https://github.com/rossjrw/pr-preview-action/blob/main/action.yml#L53.

I will try your suggestion of fitting the steps directly into our action, to remove a layer of nesting . If that fails, I'll dig more into self-hosted runners supporting composite actions.

Fantastic project btw :)

@james-s-w-clark
Copy link
Author

The issue isn't with this action specifically, but seemingly with composite actions in self-hosted runners in general.

@james-s-w-clark
Copy link
Author

@rossjrw

It's working great with the .yaml and /lib/*.sh files in-lined into our repo!

GitHub pages seems a bit picky with the deploy, but I'm trying some suggestions at JamesIves/github-pages-deploy-action#48.


Tips for self-hosted users of this app:

  • customurl will need to change, that's in the Store environment variables step
  • Iterate quicker by deploying a fake-build with a simple index.html - it's proven to work, you can then set up yarn install / build etc. and associated actions. Specify it in Deploy preview directory.
  • Before using the two .sh scripts, mark them as executable:
- name: make lib scripts runnable
  run: |
     chmod +x ./.github/workflows/lib/find-current-git-tag.sh
     chmod +x ./.github/workflows/lib/determine-auto-action.sh
    - name: Install rsync
      run:  sudo apt-get update && sudo apt-get install -y rsync

@rossjrw
Copy link
Owner

rossjrw commented Feb 17, 2023

Good to know that you've managed to get it mostly working @IdiosApps.

Sorry, I'm not sure what the linked issue has to do with self-hosted runners - could you clarify?

Is the section starting 'tips for self hosted users' something you recommend I add to my documentation?

@james-s-w-clark
Copy link
Author

I guess the linked issue may not have anything to do with it - I hit some issues with it in this process though, so they seem relevant.

In-lining everything into our repo so it isn't composite was the main advice, and it only took a few hours to iterate and get it working from there.

I think the tips may save GitHub Enterprise users a little time, so adding them to the docs may be worthwhile.
But, at least there is some searchable documentation here in this Issue that those users might find by Googling errors - so I'm happy either way :)

@rossjrw
Copy link
Owner

rossjrw commented Feb 19, 2023

Reopening this issue as a documentation task

@rossjrw rossjrw added the documentation Improvements or additions to documentation label Feb 19, 2023
@rossjrw rossjrw reopened this Feb 19, 2023
@james-s-w-clark
Copy link
Author

Reopening this issue as a documentation task

In that case, I'm happy to raise a PR for it when I get some time :)

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

No branches or pull requests

2 participants