From c1cf7089175e293751f3768390c87b6baa93a179 Mon Sep 17 00:00:00 2001 From: Doug Gschwind Date: Tue, 29 Mar 2022 15:14:29 -0700 Subject: [PATCH] fix: cleanse actions of cruft --- .commitlintrc.yaml | 2 +- .github/workflows/ci.yaml | 2 +- .gitignore | 1 + .pre-commit-config.yaml | 2 +- check-build/action.yaml | 9 +++++---- lint/README.md | 8 ++------ lint/action.yaml | 27 +++++++++++++-------------- release/action.yaml | 34 +++++++++++++++++----------------- test/action.yaml | 16 +++++++++------- 9 files changed, 50 insertions(+), 51 deletions(-) create mode 100644 .gitignore diff --git a/.commitlintrc.yaml b/.commitlintrc.yaml index 9cb74a7..5d2a5ab 100644 --- a/.commitlintrc.yaml +++ b/.commitlintrc.yaml @@ -1,2 +1,2 @@ extends: - - "@commitlint/config-conventional" + - "@open-turo/commitlint-config-conventional" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d097391..758f4fb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,7 +26,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} action-test: - name: Action test + name: Test / Action runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7c6f08..2e7b01d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: hooks: - id: commitlint stages: [commit-msg] - additional_dependencies: ["@commitlint/config-conventional"] + additional_dependencies: ["@open-turo/commitlint-config-conventional"] - repo: https://github.com/rhysd/actionlint rev: v1.6.8 hooks: diff --git a/check-build/action.yaml b/check-build/action.yaml index 14e6f9d..4eeebdd 100644 --- a/check-build/action.yaml +++ b/check-build/action.yaml @@ -1,15 +1,16 @@ -name: "Check node build" -description: "Checks whether node has been built and committed into the ./dist directory" +name: Check node build +description: Checks whether node has been built and committed into the ./dist directory inputs: github-token: required: true - description: "GitHub token that can create/delete comments. Usually - 'secrets.GITHUB_TOKEN'" + description: GitHub token that can create/delete comments. Usually - 'secrets.GITHUB_TOKEN' runs: using: composite steps: - shell: bash run: npm ci - - shell: bash + - name: Npm run prepare + shell: bash run: npm run prepare - name: Compare the commited and actual dist/ builds shell: bash diff --git a/lint/README.md b/lint/README.md index e4938ac..fc5ce26 100644 --- a/lint/README.md +++ b/lint/README.md @@ -8,11 +8,7 @@ GitHub Action runs lint on a GitHub Action jobs: build: steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Action Lint + - name: Lint uses: open-turo/actions-gha/lint@v1 ``` @@ -32,5 +28,5 @@ This action runs the following lint checks: - It will execute `npm ci` before running the `pre-commit` step. - It will run the `check-build` action. - `actionlint` will be installed and in the path to ensure that https://github.com/rhysd/actionlint can be run directly. -- This expects that `.commitlintrc.yml` will be present to enforce [`conventional-commit`](https://github.com/wagoid/commitlint-github-action). +- This expects that `.commitlintrc.yaml` will be present to enforce [`conventional-commit`](https://github.com/wagoid/commitlint-github-action). - Checkout must have history to ensure that commit message linting works. diff --git a/lint/action.yaml b/lint/action.yaml index 97a721b..1cb3cb7 100644 --- a/lint/action.yaml +++ b/lint/action.yaml @@ -1,34 +1,33 @@ -name: "GitHub Action Lint" -description: "Lints GitHub Actions" +name: GitHub Action Lint +description: Lints GitHub Actions inputs: checkout-repo: required: false - description: "Perform checkout as first step of action" - default: true + description: Perform checkout as first step of action + default: "true" github-token: required: true - description: "GitHub token that can create/delete comments. Usually - 'secrets.GITHUB_TOKEN'" + description: GitHub token that can create/delete comments. Usually - 'secrets.GITHUB_TOKEN' runs: using: composite steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 if: inputs.checkout-repo with: fetch-depth: 0 - - uses: wagoid/commitlint-github-action@v4 - if: (github.actor!= 'dependabot[bot]') && (contains(github.head_ref, 'dependabot/github_actions/') == false) - with: - configFile: .commitlintrc.yml - name: Run npm ci if needed if: hashFiles('package-lock.json') != '' shell: bash run: npm ci - - uses: KeisukeYamashita/setup-release@v1.0.2 + - name: Install actionlint + uses: KeisukeYamashita/setup-release@v1.0.2 with: repository: rhysd/actionlint - - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.0 - - uses: open-turo/actions-gha/check-build@v1 + - name: Pre-commit + uses: open-turo/action-pre-commit@v1 + - name: Check build + uses: open-turo/actions-gha/check-build@v1 if: hashFiles('package-lock.json') != '' with: github-token: ${{ inputs.github-token }} diff --git a/release/action.yaml b/release/action.yaml index 267f850..6f35e13 100644 --- a/release/action.yaml +++ b/release/action.yaml @@ -1,25 +1,25 @@ -name: "GitHub Action Release & Publish" -description: "Publish a new release of the Action - adds a new major tag" +name: GitHub Action Release & Publish +description: Publish a new release of the Action - adds a new major tag inputs: checkout-repo: required: false - description: "Perform checkout as first step of action" - default: true + description: Perform checkout as first step of action + default: "true" dry-run: required: false - description: "Whether to run semantic release in `dry-run` mode. It will override the dryRun attribute in your configuration file" + description: Whether to run semantic release in `dry-run` mode. It will override the dryRun attribute in your configuration file extra-plugins: required: false - description: "Extra plugins for pre-install. You can also specify specifying version range for the extra plugins if you prefer." + description: Extra plugins for pre-install. You can also specify specifying version range for the extra plugins if you prefer. outputs: - new_release_published: - description: "Whether a new release was published" - value: ${{ steps.release.outputs.new_release_published }} - new_release_version: - description: "Version of the new release" - value: ${{ steps.release.outputs.new_release_version }} - new_release_major_version: - description: "Major version of the new release" + new-release-published: + description: Whether a new release was published + value: ${{ steps.release.outputs.new-release-published }} + new-release-version: + description: Version of the new release + value: ${{ steps.release.outputs.new-release-version }} + new-release-major-version: + description: Major version of the new release value: ${{ steps.release.outputs.release-major }} runs: using: composite @@ -35,13 +35,13 @@ runs: dry_run: ${{ inputs.dry-run }} extra_plugins: ${{ inputs.extra-plugins }} - name: Fetch Tags - if: steps.release.outputs.new_release_published == 'true' + if: steps.release.outputs.new-release-published == 'true' shell: bash run: | git fetch --tags git clean -fd - name: Major branch - if: steps.release.outputs.new_release_published == 'true' + if: steps.release.outputs.new-release-published == 'true' uses: open-turo/action-major-release@v1 with: - major-version: ${{ steps.release.outputs.new_release_major_version }} + major-version: ${{ steps.release.outputs.new-release-major-version }} diff --git a/test/action.yaml b/test/action.yaml index 60c39e7..78b7b5f 100644 --- a/test/action.yaml +++ b/test/action.yaml @@ -1,17 +1,18 @@ -name: "GitHub Action: Test" -description: "Tests GitHub Actions" +name: GitHub Action Test +description: Tests GitHub Actions inputs: checkout-repo: required: false - description: "Perform checkout as first step of action" - default: true + description: Perform checkout as first step of action + default: "true" github-token: required: true - description: "GitHub token passed to coveralls. Usually - 'secrets.GITHUB_TOKEN'. Coveralls uses this token to verify the posted coverage data on the repo and create a new check based on the results. It is built into Github Actions and does not need to be manually specified in your secrets store." + description: GitHub token passed to coveralls. Usually - 'secrets.GITHUB_TOKEN'. Coveralls uses this token to verify the posted coverage data on the repo and create a new check based on the results. It is built into Github Actions and does not need to be manually specified in your secrets store. runs: using: composite steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 if: inputs.checkout-repo - name: Test node if: hashFiles('package-lock.json') != '' @@ -19,7 +20,8 @@ runs: run: | npm ci npm test -- --coverage - - uses: coverallsapp/github-action@master + - name: Coveralls + uses: coverallsapp/github-action@master if: hashFiles('package-lock.json') != '' with: github-token: ${{ inputs.github-token }}