Skip to content

Commit

Permalink
refactor(ci): ♻️ organize the structure and make clear the names of t…
Browse files Browse the repository at this point in the history
…he steps in workflows

* Moved `permissions` to the top for a better structure, besides there is no point in setting `permissions` inside `steps`, because we only use one step in the workflow, so it is allowed to apply `permissions` globally.
* Streamlined the structure of GitHub Workflows
* Modified funding configuration format for GitHub.
* Cleaned up unnecessary comments and improved overall readability.
  • Loading branch information
okineadev committed Jan 9, 2025
1 parent 1f95e80 commit 3c13186
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms
github: [pkief]
github: pkief
buy_me_a_coffee: pkief
custom: ['https://paypal.me/philippkief']
5 changes: 0 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# Add 'icons' label to any file changes within 'icons' folder or 'src/core/icons' typescript files
🏞️ icons:
- changed-files:
- any-glob-to-any-file: ['icons/*', 'src/core/icons/*.ts']

# Add 'translations' label to any changes within 'package.nls*.json' files or 'src/core/i18n' folder
💱 translations:
- changed-files:
- any-glob-to-any-file: ['package.nls*.json', 'src/core/i18n']

# Add 'docs' label to any changes to markdown files
📝 docs:
- changed-files:
- any-glob-to-any-file: '*.md'

# Add 'workflows' label to any changes within '.github/workflows' folder or '.github/labeler.yml' file
🔄 workflows:
- changed-files:
- any-glob-to-any-file: ['.github/workflows/*', '.github/labeler.yml']

# Add 'devcontainers' label to any changes within '.devcontainer' folder
🐋 devcontainers:
- changed-files:
- any-glob-to-any-file: '.devcontainer/*'
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ permissions:
contents: read

jobs:
build:
runs-on: [ubuntu-latest]
build-and-test:
name: Build & Test Extension

name: Build Material Icon Theme
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# This workflow closes issues with the labels "info-needed" or "invalid" that have been inactive for 14 days since being marked as stale.
name: ❌ Close inactive issues

on:
schedule:
# It is triggered every day at 1:30 AM UTC.
- cron: "30 1 * * *"

permissions:
issues: write
pull-requests: write

jobs:
close-issues:
close-stale-issues:
name: Close Stale Issues

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/color-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ permissions:
jobs:
color-check:
name: SVG Color Check

runs-on: ubuntu-latest

env:
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/icon-review.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: 🏞️ Icon Review

on:
pull_request_target:
pull_request:
paths:
- "icons/*.svg"

permissions:
contents: read
pull-requests: write

jobs:
icon-review:
name: Icon Review

runs-on: ubuntu-latest

env:
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}

permissions:
pull-requests: write

steps:
- name: 📥 Checkout Fork
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
# paths that are modified in the pull request.

name: 🔖 Labeler
on: [pull_request_target]
on:
pull_request:
paths:
- '**'

permissions:
contents: read
pull-requests: write

jobs:
label:
name: Label

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/potential-duplicates.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: "🧐 Potential Duplicates"

on:
issues:
types: [opened, edited] # edited means the issue title changed

jobs:
run:
name: Search Potential Duplicates

runs-on: ubuntu-latest

steps:
- uses: wow-actions/potential-duplicates@4d4ea0352e0383859279938e255179dd1dbb67b5 # v1.1.0
with:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/pr-closed.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: 🎉 PR closed

on:
pull_request_target:
pull_request:
types:
- closed

permissions:
contents: read
pull-requests: write

jobs:
thank_you:
thank-you:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true

permissions:
pull-requests: write
if: github.event.pull_request.merged == true

steps:
- name: 🙏 Post Thank You Comment
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
runs-on: ubuntu-latest

if: ${{ github.event.action == 'opened' || github.event.changes.title != null }}

steps:
- name: 📥 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
name: 🚀 Release + Publish

on:
workflow_dispatch:
on: [workflow_dispatch]

permissions:
id-token: write
contents: read
contents: write
attestations: write


jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write
attestations: write

steps:
- name: ✅ Use App Token for the Bot which is allowed to create releases
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
Expand Down

0 comments on commit 3c13186

Please sign in to comment.