From fa5dda77e4b052afeefd9f773f3701dcbccf8046 Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Wed, 9 Mar 2022 04:06:12 +0100 Subject: [PATCH 1/6] Make workflow reusable This allows people to use the workflow without copying its entirety, similar to calling an action. More info: https://docs.github.com/en/actions/using-workflows/reusing-workflows --- .github/workflows/CompatHelper.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index d94b38df..43844e9d 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -3,6 +3,10 @@ on: schedule: - cron: 0 0 * * * workflow_dispatch: + workflow_call: + secrets: + DOCUMENTER_KEY: + description: 'An SSH deploy key. See docs for more info.' jobs: CompatHelper: runs-on: ubuntu-latest From 6df6963b8d39ff1e1b1e7642ff03636dc179f4ed Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Wed, 9 Mar 2022 04:12:25 +0100 Subject: [PATCH 2/6] Rename secret to match workflow --- .github/workflows/CompatHelper.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 43844e9d..0893848f 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: workflow_call: secrets: - DOCUMENTER_KEY: + COMPATHELPER_PRIV: description: 'An SSH deploy key. See docs for more info.' jobs: CompatHelper: From 082b10998fc8ee177d26f3a7517320d849d5cec5 Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Wed, 9 Mar 2022 04:17:55 +0100 Subject: [PATCH 3/6] Undo rename as the workflow requires it to be called DOCUMENTER_KEY --- .github/workflows/CompatHelper.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 0893848f..43844e9d 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: workflow_call: secrets: - COMPATHELPER_PRIV: + DOCUMENTER_KEY: description: 'An SSH deploy key. See docs for more info.' jobs: CompatHelper: From caa1f4b97e552d7bc355a585c37d4b6fba3914a9 Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Wed, 9 Mar 2022 04:22:34 +0100 Subject: [PATCH 4/6] Add to README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index e5a8f060..119d9370 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,23 @@ Create a file at `.github/workflows/CompatHelper.yml` with the contents of the [ If you need to use any special arguments for the `main` function, you can modify this file to add them. +You can also use a [reusable workflow](https://docs.github.com/en/actions/using-workflows/reusing-workflows): + +```yaml +name: CompatHelper + +on: + workflow_dispatch: + schedule: + - cron: 0 0 1 * * # First day of each month + +jobs: + compathelper: + uses: JuliaRegistries/CompatHelper.jl/.github/workflows/CompatHelper.yml@sm/reusable-workflow + secrets: + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} +``` + ### GitLab For GitLab you will want to add CompatHelper as a job in your `.gitlab-ci.yml` file such as: From 1b7831e96eac93bffc30b06fac79cfdd23b1b6ea Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Wed, 9 Mar 2022 04:23:55 +0100 Subject: [PATCH 5/6] Fix branch name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 119d9370..40431606 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ on: jobs: compathelper: - uses: JuliaRegistries/CompatHelper.jl/.github/workflows/CompatHelper.yml@sm/reusable-workflow + uses: JuliaRegistries/CompatHelper.jl/.github/workflows/CompatHelper.yml@master secrets: DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} ``` From 4732ccb2901c02a82c56fd466094ff59351b5b3f Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Wed, 9 Mar 2022 04:32:59 +0100 Subject: [PATCH 6/6] Require key --- .github/workflows/CompatHelper.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 43844e9d..e837d70a 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -7,6 +7,7 @@ on: secrets: DOCUMENTER_KEY: description: 'An SSH deploy key. See docs for more info.' + required: true jobs: CompatHelper: runs-on: ubuntu-latest