Skip to content

Commit

Permalink
Use reusable workflows over a GitHub Action (#17)
Browse files Browse the repository at this point in the history
* Minor improvements to build, fix prettier

* Remove github action

* Add reusable workflows
  • Loading branch information
rogermparent authored Jul 26, 2022
1 parent 384b1a7 commit 01e2543
Show file tree
Hide file tree
Showing 17 changed files with 1,262 additions and 1,669 deletions.
7 changes: 1 addition & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ module.exports = {
parserOptions: {
sourceType: "module",
},
extends: [
"airbnb-base",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint",
],
extends: ["airbnb-base", "plugin:@typescript-eslint/recommended", "prettier"],
plugins: ["import", "prettier", "@typescript-eslint"],
env: {
browser: false,
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/link-check-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check all links in the repository
on:
workflow_call:
inputs:
config:
description: "The path to the link-check config file"
default: "config/link-check/config.yml"
jobs:
run:
name: Link Check All
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max-http-header-size=65536'
steps:
- uses: actions/checkout@v3
- name: Run Link Check
id: check
run: npx repo-link-check -c ${{ inputs.config }}
56 changes: 56 additions & 0 deletions .github/workflows/link-check-deployment-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Check new links against deployment
on:
workflow_call:
inputs:
main:
description: "The main branch of this repository"
default: "main"
jobs:
run:
name: Run
runs-on: ubuntu-latest
if:
github.event.deployment.ref != ${{ inputs.main }} &&
github.event.deployment_status.state == 'success'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run Link Check
id: check
run: |
set +e
body="$(
npx repo-link-check \
-d ${{ main }} -c config/link-check/config.yml \
-r ${{ github.event.deployment.payload.web_url }}
)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=report::$body"
exit 0
- name: Find Current Pull Request
id: findPr
uses: jwalton/[email protected]

- name: Find Existing Link Check Report Comment
uses: peter-evans/find-comment@v2
id: findComment
continue-on-error: true
with:
issue-number: ${{ steps.findPr.outputs.pr }}
comment-author: 'github-actions[bot]'
body-includes: <h1 id="link-check">Link Check Report</h1>

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ steps.findPr.outputs.pr }}
comment-id: ${{ steps.findComment.outputs.comment-id }}
body: |
<h1 id="link-check">Link Check Report</h1>
${{ steps.check.outputs.report }}
edit-mode: replace
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Loading

0 comments on commit 01e2543

Please sign in to comment.