Skip to content

Commit

Permalink
fix: cleanse actions of cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
dgschwindturo committed Mar 29, 2022
1 parent 5da7de1 commit c1cf708
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .commitlintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
extends:
- "@commitlint/config-conventional"
- "@open-turo/commitlint-config-conventional"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions check-build/action.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 2 additions & 6 deletions lint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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.
27 changes: 13 additions & 14 deletions lint/action.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- name: Install actionlint
uses: KeisukeYamashita/[email protected]
with:
repository: rhysd/actionlint
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
- 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 }}
34 changes: 17 additions & 17 deletions release/action.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }}
16 changes: 9 additions & 7 deletions test/action.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
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') != ''
shell: bash
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 }}

0 comments on commit c1cf708

Please sign in to comment.