Skip to content

Commit

Permalink
Fix gha smells:
Browse files Browse the repository at this point in the history
- Avoid executing  scheduled workflows on forks
- Use 'if' for upload-artifact action
- Use permissions whenever using Github Token
  • Loading branch information
ceddy4395 committed Apr 28, 2024
1 parent 91fa553 commit 10ebd60
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ jobs:
- name: Upload test coverage artifact
uses: actions/upload-artifact@v3
if: success()
with:
name: report
path: report/
1 change: 1 addition & 0 deletions .github/workflows/compatiblity_test_on_schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
matrix_preparation:
name: Prepare Container List
runs-on: ubuntu-latest
if: ${{github.event_name != 'schedule' || github.repository == 'hpcaitech-colossalai'}}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/draft_github_release_post_after_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
name: Draft Release Post
if: ( github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true ) && github.repository == 'hpcaitech/ColossalAI'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/report_test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
report-test-coverage:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
steps:
- name: "Download artifact"
uses: actions/github-script@v6
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
sync-submodule:
runs-on: ubuntu-latest
if: github.repository == 'hpcaitech/ColossalAI'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down

0 comments on commit 10ebd60

Please sign in to comment.