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

Update basic actions workflow example so it does not fail #32531

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Plsr
Copy link

@Plsr Plsr commented Apr 16, 2024

In the basic GitHub actions workflow example, install and run bats locally instead of globally.

Why:

When I was following the example provided by the docs, my workflow run would fail:

Run npm install -g bats
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/share/man/man7
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/share/man/man[7](https://github.com/Plsr/actions-test/actions/runs/8700605027/job/23861082814#step:4:8)'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/share/man/man7'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/share/man/man7'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user

For reference, this is my failed run and the matching workflow file.

This isn't a great experience for first-time learners.

What's being changed (if available, include any code snippets, screenshots, or gifs):

The proposed solution to this is not installing bats globally:

jobs:
  check-bats-version:
    runs-on: ubuntu-latest
    steps: 
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: 
          node_version: '20'
      - run: npm install bats
      - run: ./node_modules/bats/bin/bats -v

(Successful workflow, for reference)

CleanShot 2024-04-16 at 08 24 15@2x

Check off the following:

  • I have reviewed my changes in staging, available via the View deployment link in this PR's timeline (this link will be available after opening the PR).

    • For content changes, you will also see an automatically generated comment with links directly to pages you've modified. The comment won't appear if your PR only edits files in the data directory.

- [ ] For content changes, I have completed the self-review checklist.

Install and run bats locally instead of globally
Copy link

welcome bot commented Apr 16, 2024

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Apr 16, 2024
@nguyenalex836 nguyenalex836 added content This issue or pull request belongs to the Docs Content team actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team labels Apr 16, 2024
@nguyenalex836
Copy link
Contributor

@Plsr Thanks so much for opening a PR! I'll get this triaged for review ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants