From 05864df1ad2f1501578143c7519d3ebe255191b9 Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:13:58 -0700 Subject: [PATCH 01/10] Add demo workflow for testing --- .github/workflows/github-actions-demo.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 00000000..e5bb1615 --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file From 2d6e48638017700b8d412750bd271e759776adb0 Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:18:18 -0700 Subject: [PATCH 02/10] Change action to trigger on PR --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index e5bb1615..2c1d9daf 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -1,6 +1,6 @@ name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] +on: [ pull_request ] jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest From 5531f7e9ccc84b247da207d92804e093f2664f95 Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:23:37 -0700 Subject: [PATCH 03/10] Add draft url checker --- .github/workflows/url_link_check.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/url_link_check.yml diff --git a/.github/workflows/url_link_check.yml b/.github/workflows/url_link_check.yml new file mode 100644 index 00000000..f201c371 --- /dev/null +++ b/.github/workflows/url_link_check.yml @@ -0,0 +1,13 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [ push ] +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Link Checker + # Reference: https://github.com/lycheeverse/lychee-action + id: lychee + uses: lycheeverse/lychee-action@v1 \ No newline at end of file From 24c7093e4b2237f4f7759ffc6d566f68dc1d22d2 Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:25:03 -0700 Subject: [PATCH 04/10] Rename url checker on github actions --- .github/workflows/url_link_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/url_link_check.yml b/.github/workflows/url_link_check.yml index f201c371..d6075b8d 100644 --- a/.github/workflows/url_link_check.yml +++ b/.github/workflows/url_link_check.yml @@ -1,5 +1,5 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +name: Check links +run-name: ${{ github.actor }} is testing links on: [ push ] jobs: linkChecker: From 46201fb70bcaca2eca342b829c183fe2c3add99e Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:29:47 -0700 Subject: [PATCH 05/10] Add chron link checker and test for link check on push --- .github/CONTRIBUTING.md | 2 +- .github/workflows/github-actions-demo.yml | 18 ------------ .github/workflows/link_check_chron.yml | 28 +++++++++++++++++++ ...url_link_check.yml => link_check_push.yml} | 5 ++-- 4 files changed, 32 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/github-actions-demo.yml create mode 100644 .github/workflows/link_check_chron.yml rename .github/workflows/{url_link_check.yml => link_check_push.yml} (66%) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c831c4b9..ac3ea98a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -23,7 +23,7 @@ to contribute. The NMDC team strives to create a welcoming environment for editors, users and other contributors. -Please carefully read NMDC's [Code of Conduct](https://github.com/microbiomedata/nmdc-schema/blob/main/CODE_OF_CONDUCT.md). +Please carefully read NMDC's [Code of Conduct](https://github.com/microbiomedata/nmdc-schema/blob/main/CODE_OF_CONDUCT!!.md). diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml deleted file mode 100644 index 2c1d9daf..00000000 --- a/.github/workflows/github-actions-demo.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [ pull_request ] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/.github/workflows/link_check_chron.yml b/.github/workflows/link_check_chron.yml new file mode 100644 index 00000000..82362445 --- /dev/null +++ b/.github/workflows/link_check_chron.yml @@ -0,0 +1,28 @@ +# This workflow will check all the links in the markdown files in the repository every day at 6 PM. + +name: Check links on schedule +# https://github.com/lycheeverse/lychee-action + +on: + repository_dispatch: + workflow_dispatch: + schedule: + - cron: "00 18 * * *" + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v1 + + - name: Create Issue From File + if: env.lychee_exit_code != 0 + uses: peter-evans/create-issue-from-file@v4 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: report, automated issue \ No newline at end of file diff --git a/.github/workflows/url_link_check.yml b/.github/workflows/link_check_push.yml similarity index 66% rename from .github/workflows/url_link_check.yml rename to .github/workflows/link_check_push.yml index d6075b8d..54400eb6 100644 --- a/.github/workflows/url_link_check.yml +++ b/.github/workflows/link_check_push.yml @@ -1,5 +1,6 @@ -name: Check links -run-name: ${{ github.actor }} is testing links +# This workflow will check all the links in the markdown files in the repository whenever a push event occurs. + +name: Check links on push on: [ push ] jobs: linkChecker: From cd02160b976e271b37f865233f1fca49fe2b79fe Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:32:55 -0700 Subject: [PATCH 06/10] Modify link checking workflow to fail on error --- .github/workflows/link_check_push.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/link_check_push.yml b/.github/workflows/link_check_push.yml index 54400eb6..0ba83414 100644 --- a/.github/workflows/link_check_push.yml +++ b/.github/workflows/link_check_push.yml @@ -11,4 +11,6 @@ jobs: - name: Link Checker # Reference: https://github.com/lycheeverse/lychee-action id: lychee - uses: lycheeverse/lychee-action@v1 \ No newline at end of file + uses: lycheeverse/lychee-action@v1 + with: + falil: true \ No newline at end of file From 4d08db9519ecdb8a97faebbe0ab09494714af64c Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:34:19 -0700 Subject: [PATCH 07/10] Fix typo in workflow --- .github/workflows/link_check_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link_check_push.yml b/.github/workflows/link_check_push.yml index 0ba83414..1cafe169 100644 --- a/.github/workflows/link_check_push.yml +++ b/.github/workflows/link_check_push.yml @@ -13,4 +13,4 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v1 with: - falil: true \ No newline at end of file + fail: true \ No newline at end of file From 4601077ff0e1920b6a6df17bc32f4ee78853520c Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:35:34 -0700 Subject: [PATCH 08/10] Revert to accurate link after testing --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ac3ea98a..c831c4b9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -23,7 +23,7 @@ to contribute. The NMDC team strives to create a welcoming environment for editors, users and other contributors. -Please carefully read NMDC's [Code of Conduct](https://github.com/microbiomedata/nmdc-schema/blob/main/CODE_OF_CONDUCT!!.md). +Please carefully read NMDC's [Code of Conduct](https://github.com/microbiomedata/nmdc-schema/blob/main/CODE_OF_CONDUCT.md). From e85b3fa542ed27fcd7b34f9b231ba6fea918564a Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:42:03 -0700 Subject: [PATCH 09/10] Add complete link to PR template so gh action doesn't fail --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/link_check_push.yml | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9769229d..02a071bf 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@ ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing document](CONTRIBUTING.md)? -* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../../pulls) for the same update/change? +* [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/microbiomedata/nmdc_notebooks/pulls) for the same update/change? * [ ] Does your PR link to an issue? * [ ] Have you described the changes this PR will make? diff --git a/.github/workflows/link_check_push.yml b/.github/workflows/link_check_push.yml index 1cafe169..06246d2e 100644 --- a/.github/workflows/link_check_push.yml +++ b/.github/workflows/link_check_push.yml @@ -1,16 +1,18 @@ -# This workflow will check all the links in the markdown files in the repository whenever a push event occurs. +# This workflow will check all the links in the markdown files in the repository on each PR or by manual trigger. -name: Check links on push -on: [ push ] +name: Check links on pull request +on: + pull_request: + workflow_dispatch: jobs: linkChecker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - name: Link Checker - # Reference: https://github.com/lycheeverse/lychee-action - id: lychee - uses: lycheeverse/lychee-action@v1 - with: - fail: true \ No newline at end of file + - name: Link Checker + # Reference: https://github.com/lycheeverse/lychee-action + id: lychee + uses: lycheeverse/lychee-action@v1 + with: + fail: true \ No newline at end of file From f608c40a9b7e0e79f5bfe031702bc899b4df9654 Mon Sep 17 00:00:00 2001 From: Katherine Heal Date: Tue, 16 Jul 2024 16:43:09 -0700 Subject: [PATCH 10/10] Change name of github action --- .github/workflows/{link_check_push.yml => link_check_pr.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{link_check_push.yml => link_check_pr.yml} (100%) diff --git a/.github/workflows/link_check_push.yml b/.github/workflows/link_check_pr.yml similarity index 100% rename from .github/workflows/link_check_push.yml rename to .github/workflows/link_check_pr.yml