diff mbox series

[1/4] ci: use a newer `github-script` version

Message ID 472481561f03900fb519065d88ae8af910bea794.1670423680.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit 63357b79c9384158ff169b910eab501dff4abf8b
Headers show
Series Avoid using deprecated features in Git's GitHub workflows | expand

Commit Message

Johannes Schindelin Dec. 7, 2022, 2:34 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

The old version we currently use runs in node.js v12.x, which is being
deprecated in GitHub Actions. The new version uses node.js v16.x.

Incidentally, this also avoids the warning about the deprecated
`::set-output::` workflow command because the newer version of the
`github-script` Action uses the recommended new way to specify outputs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 .github/workflows/main.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Taylor Blau Dec. 7, 2022, 10:22 p.m. UTC | #1
On Wed, Dec 07, 2022 at 02:34:37PM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> The old version we currently use runs in node.js v12.x, which is being
> deprecated in GitHub Actions. The new version uses node.js v16.x.
>
> Incidentally, this also avoids the warning about the deprecated
> `::set-output::` workflow command because the newer version of the
> `github-script` Action uses the recommended new way to specify outputs.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>

It took me a second to remember why my S-o-b was here, but it looks like
this is from when I queued this patch in [1], which is on 'master' as of
63357b79c9 (ci: use a newer `github-script` version, 2022-11-08).

So having my S-o-b here is definitely OK (since I was the one who put it
there in the first place!), but I don't think we need to re-queue this
patch, unless it was reverted out in the meantime (which it doesn't
appear to be).

Thanks,
Taylor

[1]: https://lore.kernel.org/git/Y2q9723uEtfkJrah@nand.local/
diff mbox series

Patch

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 5262823eb1c..43d47824dd3 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -37,14 +37,14 @@  jobs:
           echo "::set-output name=enabled::$enabled"
       - name: skip if the commit or tree was already tested
         id: skip-if-redundant
-        uses: actions/github-script@v3
+        uses: actions/github-script@v6
         if: steps.check-ref.outputs.enabled == 'yes'
         with:
           github-token: ${{secrets.GITHUB_TOKEN}}
           script: |
             try {
               // Figure out workflow ID, commit and tree
-              const { data: run } = await github.actions.getWorkflowRun({
+              const { data: run } = await github.rest.actions.getWorkflowRun({
                 owner: context.repo.owner,
                 repo: context.repo.repo,
                 run_id: context.runId,
@@ -54,7 +54,7 @@  jobs:
               const tree_id = run.head_commit.tree_id;
 
               // See whether there is a successful run for that commit or tree
-              const { data: runs } = await github.actions.listWorkflowRuns({
+              const { data: runs } = await github.rest.actions.listWorkflowRuns({
                 owner: context.repo.owner,
                 repo: context.repo.repo,
                 per_page: 500,