Skip to content

Commit

Permalink
ci: cleanup workflows (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter authored Nov 18, 2023
1 parent c7a5c79 commit 0814bb2
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 33 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ on:

jobs:
format:
name: Format Code
name: Format userstyles
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.USERSTYLES_TOKEN }}
- uses: actions/setup-node@v3

- name: Format files
- name: Setup Node.js
uses: actions/setup-node@v3

- name: Format userstyles
run: npx prettier --write styles/**/*.css

- name: Pull changes
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:

jobs:
generate-health-files:
runs-on: ubuntu-latest
name: Generate health files
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
Expand Down Expand Up @@ -52,4 +52,3 @@ jobs:
commit_message: "chore: generate health files"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
branch: ${{ github.ref }}
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
16 changes: 8 additions & 8 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: github/issue[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-labeler.yml
enable-versioned-regex: 0
include-title: 1
sync-labels: 1
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
- name: Add issue labels
uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-labeler.yml
enable-versioned-regex: 0
include-title: 1
sync-labels: 1
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
jobs:
lint:
name: Lint Userstyles

runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/maintainers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ env:

jobs:
sync-maintainers:
runs-on: ubuntu-latest
name: Sync maintainers
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -36,5 +36,3 @@ jobs:
run: deno task sync-maintainers
env:
GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }}

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
1 change: 1 addition & 0 deletions .github/workflows/pr-titles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- name: Lint pull request title
uses: amannn/action-semantic-pull-request@v5
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]

- name: Add pull request labels
uses: actions/[email protected]
with:
configuration-path: .github/pr-labeler.yml
sync-labels: true
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ on:

jobs:
update:
name: Update
name: Sync labels
runs-on: ubuntu-latest

steps:
- uses: r7kamura/github-label-sync-action@v0
- name: Sync labels
uses: r7kamura/github-label-sync-action@v0
if: ${{ github.repository == 'catppuccin/userstyles' }}
with:
allow_added_labels: "true"
28 changes: 15 additions & 13 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
id: typos
continue-on-error: true
- uses: actions/checkout@v4

# 'continue-on-error' will always succeed, we should exit based on the outcome and not the conclusion
# ref: https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context
- name: Fail when typos are found in pull request
if: ${{ github.event_name == 'pull_request' && steps.typos.outcome != 'success' }}
run: "exit 1"
- name: Check for typos
uses: crate-ci/typos@master
id: typos
continue-on-error: true

# We always want this check to pass on branch 'main' but continue to fail on PRs
- name: Pass on 'main' branch
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
run: "exit 0"
# 'continue-on-error' will always succeed, we should exit based on the outcome and not the conclusion
# ref: https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context
- name: Fail when typos are found in pull request
if: ${{ github.event_name == 'pull_request' && steps.typos.outcome != 'success' }}
run: "exit 1"

# We always want this check to pass on branch 'main' but continue to fail on PRs
- name: Pass on 'main' branch
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
run: "exit 0"

0 comments on commit 0814bb2

Please sign in to comment.