docs
docs copied to clipboard
Update basic actions workflow example so it does not fail
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)
Check off the following:
-
[x] 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
datadirectory.
- 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
~~- [ ] For content changes, I have completed the self-review checklist.~~
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.
@Plsr Thanks so much for opening a PR! I'll get this triaged for review ✨
Hi @Plsr! Thank you for contribution ⭐ After reviewing the workflow and testing the example, we have decided that this may be an individual permissions error. We will close the issue with no further actions. Our goal is to ensure the examples are simple and straightforward for everyone to use. Thank you for understanding and being a valued part of our community.