Skip to content

Commit

Permalink
chore(ci): Fix potential github action smells (cypress-io#29416)
Browse files Browse the repository at this point in the history
* chore(ci): fix gha smells

- Avoid running CI related actions when no source code has changed
- Use permissions whenever using Github Token
- Avoid executing  scheduled workflows on forks

* Fix typo in 'if' statement for gha workflow

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>

* Add contents write permissions to upload_release_asset

---------

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
  • Loading branch information
3 people authored and jj497 committed May 5, 2024
1 parent e671012 commit d629005
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/update-browser-versions.yml
Expand Up @@ -10,6 +10,8 @@ jobs:
env:
CYPRESS_BOT_APP_ID: ${{ secrets.CYPRESS_BOT_APP_ID }}
BASE_BRANCH: develop
# Prevent from running this workflow on forks
if: github.repository == 'cypress-io/cypress'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/update_v8_snapshot_cache.yml
Expand Up @@ -8,6 +8,23 @@ on:
push:
branches:
- 'release/**'
paths-ignore:
- .husky/**
- .vscode/**
- .eslintrc.js
- .gitattributes
- .gitignore
- .percy.yml
- .prettierignore
- .releaserc.js
- .yarnclean
- CHANGELOG.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE
- README.md
- ROADMAP.md
- SECURITY.md
workflow_dispatch:
inputs:
branch:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/upload_release_asset.yml
Expand Up @@ -13,6 +13,8 @@ jobs:
FOSSA_API_KEY: ${{secrets.FOSSAAPIKEY}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
Expand Down

0 comments on commit d629005

Please sign in to comment.