Created
November 1, 2024 08:57
-
-
Save tamakiii/e202a4bf140f819c64625724991754ae to your computer and use it in GitHub Desktop.
Revisions
-
tamakiii created this gist
Nov 1, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ ## Set timeouts Specify timeouts in GitHub Actions to prevent prolonged tasks ```yaml timeout-minutes: 5 ``` ## Catch Bash Pipe Errors Define the default shell as Bash in the workflow settings, enabling pipefail to detect errors during piping. ```yaml defaults: run: shell: bash --noprofile --norc -eo pipefail {0} ``` ## Automatic Workflow Cancellation Use concurrency to cancel outdated workflows, reducing unnecessary wait times and costs. ```yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true # ``` ## Job-Level Permissions for GITHUB_TOKEN Control access by disabling default permissions at the workflow level and assigning only necessary permissions per job to minimize security risks. ```yaml permissions: contents: read ```