From 0990a2313c470d477f799a600ce3e323916f8f4b Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:03:48 -0500 Subject: [PATCH 1/3] ci: whitespace/formatting, add names to steps --- .github/workflows/format.yml | 4 +++- .github/workflows/generate.yml | 2 +- .github/workflows/issues.yml | 14 +++++++------- .github/workflows/lint.yml | 1 - .github/workflows/maintainers.yml | 3 +-- .github/workflows/pr-titles.yml | 1 + .github/workflows/pull-requests.yml | 4 +++- .github/workflows/sync-labels.yml | 1 + .github/workflows/typos.yml | 28 +++++++++++++++------------- 9 files changed, 32 insertions(+), 26 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index bb48a864f2..432e425bef 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -13,7 +13,9 @@ jobs: - uses: actions/checkout@v4 with: token: ${{ secrets.USERSTYLES_TOKEN }} - - uses: actions/setup-node@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 - name: Format files run: npx prettier --write styles/**/*.css diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index c58e3ce69e..f47bf7fd5e 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -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. diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 9b22cb7228..373804718d 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v3.1 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/issue-labeler.yml - enable-versioned-regex: 0 - include-title: 1 - sync-labels: 1 + - uses: github/issue-labeler@v3.1 + 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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 557c54460d..a6984d397c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,6 @@ env: jobs: lint: name: Lint Userstyles - runs-on: ubuntu-latest steps: diff --git a/.github/workflows/maintainers.yml b/.github/workflows/maintainers.yml index 22f0639abc..d9d68e8192 100644 --- a/.github/workflows/maintainers.yml +++ b/.github/workflows/maintainers.yml @@ -11,8 +11,8 @@ env: jobs: sync-maintainers: - runs-on: ubuntu-latest name: Sync maintainers + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -36,5 +36,4 @@ jobs: run: deno task sync-maintainers env: GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }} - # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json diff --git a/.github/workflows/pr-titles.yml b/.github/workflows/pr-titles.yml index 52bc616c0b..fcc1da46df 100644 --- a/.github/workflows/pr-titles.yml +++ b/.github/workflows/pr-titles.yml @@ -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 diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index e8f13d2aa9..205e5b76b9 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -10,7 +10,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/labeler@v4.0.3 + + - name: Label pull requests + uses: actions/labeler@v4.0.3 with: configuration-path: .github/pr-labeler.yml sync-labels: true diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 9f053fe93f..81264a1a3d 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -11,6 +11,7 @@ jobs: update: name: Update runs-on: ubuntu-latest + steps: - uses: r7kamura/github-label-sync-action@v0 if: ${{ github.repository == 'catppuccin/userstyles' }} diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 1a53c8742b..f9aae64bce 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -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" From 334523233b9c3f39c9f289c4f1ed4ec5cde36108 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:12:22 -0500 Subject: [PATCH 2/3] impr: step and job names --- .github/workflows/format.yml | 4 ++-- .github/workflows/issues.yml | 3 ++- .github/workflows/pull-requests.yml | 2 +- .github/workflows/sync-labels.yml | 5 +++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 432e425bef..53dffbb2c5 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -6,7 +6,7 @@ on: jobs: format: - name: Format Code + name: Format userstyles runs-on: ubuntu-latest steps: @@ -17,7 +17,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 - - name: Format files + - name: Format userstyles run: npx prettier --write styles/**/*.css - name: Pull changes diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 373804718d..e930eb985c 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v3.1 + - name: Add issue labels + uses: github/issue-labeler@v3.1 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/issue-labeler.yml diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 205e5b76b9..5319bf2e43 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Label pull requests + - name: Add pull request labels uses: actions/labeler@v4.0.3 with: configuration-path: .github/pr-labeler.yml diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 81264a1a3d..d730096633 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -9,11 +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" From a7763b07fa93ed627bd3e7f6a1e177a9bbb2ca71 Mon Sep 17 00:00:00 2001 From: winston Date: Sat, 18 Nov 2023 04:09:37 +0100 Subject: [PATCH 3/3] chore: drop yamlls comment --- .github/workflows/generate.yml | 1 - .github/workflows/issues.yml | 1 - .github/workflows/maintainers.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index f47bf7fd5e..67babd057a 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -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 diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index e930eb985c..47803d9a12 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -19,4 +19,3 @@ jobs: enable-versioned-regex: 0 include-title: 1 sync-labels: 1 -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json diff --git a/.github/workflows/maintainers.yml b/.github/workflows/maintainers.yml index d9d68e8192..f51753bc39 100644 --- a/.github/workflows/maintainers.yml +++ b/.github/workflows/maintainers.yml @@ -36,4 +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