Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update actions file #39871

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 15 additions & 9 deletions .github/workflows/authors.yml
@@ -1,22 +1,28 @@
name: "authors update"
on:
workflow_dispatch:
name: authors update
on: workflow_dispatch

jobs:
authors_update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0' # this is required to actually get all the authors
- run: "tools/update-authors.js" # run the AUTHORS tool
fetch-depth: 0 # this is required to actually get all the authors
- run: tools/update-authors.js # run the AUTHORS tool
- uses: gr2m/create-or-update-pull-request-action@v1 # create a PR or update the Action's existing PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "meta: update AUTHORS"
body: "If this PR exists, there's presumably new additions to the AUTHORS file. This is an automatically generated PR by the `authors.yml` GitHub Action, which runs `tools/update-authors.js` and submits a new PR or updates an existing PR.\n\nPlease note that there might be duplicate entries. If there are, please remove them and add the duplicate emails to .mailmap directly to this PR."
branch: "actions/authors-update" # custom branch *just* for this Action.
commit-message: "meta: update AUTHORS"
title: 'meta: update AUTHORS'
commit-message: 'meta: update AUTHORS'
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
body: >
Mesteery marked this conversation as resolved.
Show resolved Hide resolved
If this PR exists, there's presumably new additions to the AUTHORS file.
This is an automatically generated PR by the `authors.yml` GitHub Action,
which runs `tools/update-authors.js` and submits a new PR or updates an existing PR.


Please note that there might be duplicate entries. If there are, please remove them and
add the duplicate emails to .mailmap directly to this PR.
branch: actions/authors-update # custom branch *just* for this Action.
labels: meta
35 changes: 9 additions & 26 deletions .github/workflows/auto-start-ci.yml
@@ -1,4 +1,3 @@
---
name: Auto Start CI

on:
Expand All @@ -7,23 +6,23 @@ on:
# optimistic, it can take longer to run.
# To understand why `schedule` is used instead of other events, refer to
# ./doc/guides/commit-queue.md
- cron: "*/5 * * * *"
- cron: '*/5 * * * *'

env:
NODE_VERSION: lts/*

jobs:
startCI:
start-ci:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Install dependencies
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install node-core-utils
run: npm install -g node-core-utils

Expand All @@ -32,26 +31,6 @@ jobs:
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV

# Get Pull Requests
- name: Get Pull Requests
uses: octokit/graphql-action@v2.x
id: get_prs_for_ci
with:
query: |
query prs($owner:String!, $repo:String!) {
repository(owner:$owner, name:$repo) {
pullRequests(labels: ["request-ci"], states: OPEN, last: 100) {
nodes {
number
}
}
}
}
owner: ${{ env.OWNER }}
repo: ${{ env.REPOSITORY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup node-core-utils
run: |
ncu-config set username ${{ secrets.JENKINS_USER }}
Expand All @@ -60,5 +39,9 @@ jobs:
ncu-config set owner ${{ env.OWNER }}
ncu-config set repo ${{ env.REPOSITORY }}

- name: Start CI
run: ./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
- name: Get Pull Requests and start CI
run: |
prs=`gh pr list --repo ${{ github.repository }} --limit 100 --json number -q 'map(.number) | .[]'`
./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $prs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 5 additions & 11 deletions .github/workflows/build-tarball.yml
Expand Up @@ -4,20 +4,15 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- master
- main
- v[0-9]+.x-staging
- v[0-9]+.x
branches: [master, main, 'v[0-9]+.x-staging', 'v[0-9]+.x']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find multiline arrays easier to read (and also to review when elements are added/removed)

Copy link
Member Author

@Mesteery Mesteery Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line just above is (and was) a single line areay, and the two lines have almost the same size. Personally I find that when the inline version is short it's easier to read, otherwise I leave it multiline, like in coverage-linux.yml.
But if you prefer multiline arrays, there is no problem, I would put all arrays in multiline.

Copy link
Member

@targos targos Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I didn't put my comment on the best line. I don't feel strongly about the types and branches fields, but I would like at least the paths-ignore to stay multiline


env:
FLAKY_TESTS: dontcare
PYTHON_VERSION: 3.9

jobs:
build-tarball:
if: github.event.pull_request.draft == false
env:
PYTHON_VERSION: 3.9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -36,13 +31,11 @@ jobs:
mkdir tarballs
mv *.tar.gz tarballs
- name: Upload tarball artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: tarballs
path: tarballs
test-tarball-linux:
env:
PYTHON_VERSION: 3.9
needs: build-tarball
runs-on: ubuntu-latest
steps:
Expand All @@ -54,9 +47,10 @@ jobs:
- name: Environment Information
run: npx envinfo
- name: Download tarball
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: tarballs
path: tarballs
- name: Extract tarball
run: |
tar xzf tarballs/*.tar.gz -C $RUNNER_TEMP
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/build-windows.yml
Expand Up @@ -3,13 +3,22 @@ name: build-windows
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '**.md'
- doc/**
- AUTHORS
- .mailmap
- .github/**
- '!.github/workflows/build-windows.yml'
push:
branches:
- master
- main
- canary
- v[0-9]+.x-staging
- v[0-9]+.x
branches: [master, main, canary, 'v[0-9]+.x-staging', 'v[0-9]+.x']
paths-ignore:
- '**.md'
- doc/**
- AUTHORS
- .mailmap
- .github/**
- '!.github/workflows/build-windows.yml'

env:
PYTHON_VERSION: 3.9
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/close-stalled.yml
@@ -1,21 +1,26 @@
name: Close stalled issues and PRs
on:
schedule:
- cron: "0 0 * * *"
- cron: 0 0 * * *

env:
CLOSE_MESSAGE: >
Closing this because it has stalled. Feel free to reopen if this issue is still relevant,
or to ping the collaborator who labelled it stalled if you have any questions.

jobs:
stale:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-close: 30
stale-pr-label: stalled
stale-issue-label: stalled
close-issue-message: Closing this because it has stalled. Feel free to reopen if this issue is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.
close-pr-message: Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.
close-issue-message: ${{ env.CLOSE_MESSAGE }}
close-pr-message: ${{ env.CLOSE_MESSAGE }}
# used to filter issues to check whether or not should be closed, avoids hitting maximum operations allowed if needing to paginate through all open issues
only-labels: stalled
# max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/comment-labeled.yml
@@ -1,29 +1,35 @@
name: Comment on issues and PRs when labelled
name: Comment on issues and PRs when labeled
targos marked this conversation as resolved.
Show resolved Hide resolved
on:
issues:
types: [labeled]
pull_request_target:
types: [labeled]

env:
STALE_MESSAGE: >-
This issue/PR was marked as stalled, it will be automatically closed in 30 days.
If it should remain open, please leave a comment explaining why it should remain open.
FAST_TRACK_MESSAGE: Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve.

jobs:
staleComment:
stale-comment:
if: github.repository == 'nodejs/node' && github.event.label.name == 'stalled'
runs-on: ubuntu-latest
steps:
- name: Post stalled comment
env:
COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }}
COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }}
run: |
curl -X POST $COMMENTS_URL \
-H "Content-Type: application/json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
--data '{ "body": "This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open." }'
--data "{ \"body\": \"$STALE_MESSAGE\" }"

fastTrack:
if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'fast-track'
fast-track:
if: github.repository == 'nodejs/node' && github.event.issue.pull_request && github.event.label.name == 'fast-track'
runs-on: ubuntu-latest
steps:
- name: Request Fast-Track
run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$FAST_TRACK_MESSAGE"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve."
2 changes: 1 addition & 1 deletion .github/workflows/commit-lint.yml
@@ -1,4 +1,4 @@
name: "Commit messages adheres to guidelines at https://goo.gl/p2fr5Q"
name: Commit messages adheres to guidelines at https://goo.gl/p2fr5Q

on: [pull_request]

Expand Down
35 changes: 9 additions & 26 deletions .github/workflows/commit-queue.yml
@@ -1,4 +1,3 @@
---
# This action requires the following secrets to be set on the repository:
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
Expand All @@ -12,7 +11,7 @@ on:
# be read-only, and the Action won't have access to any other repository
# secrets, which it needs to access Jenkins API.
schedule:
- cron: "*/5 * * * *"
- cron: '*/5 * * * *'

env:
NODE_VERSION: lts/*
Expand All @@ -33,11 +32,11 @@ jobs:
# for push as well.
token: ${{ secrets.GH_USER_TOKEN }}

# Install dependencies
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install node-core-utils
run: npm install -g node-core-utils@latest

Expand All @@ -47,27 +46,6 @@ jobs:
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "DEFAULT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV

- name: Get Pull Requests
uses: octokit/graphql-action@v2.x
id: get_mergable_pull_requests
with:
query: |
query release($owner:String!,$repo:String!, $base_ref:String!) {
repository(owner:$owner, name:$repo) {
pullRequests(baseRefName: $base_ref, labels: ["commit-queue"], states: OPEN, last: 100) {
nodes {
number
}
}
}
}
owner: ${{ env.OWNER }}
repo: ${{ env.REPOSITORY }}
# Commit queue is only enabled for the default branch on the repository
base_ref: ${{ env.DEFAULT_BRANCH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure node-core-utils
run: |
ncu-config set branch ${DEFAULT_BRANCH}
Expand All @@ -78,5 +56,10 @@ jobs:
ncu-config set repo "${REPOSITORY}"
ncu-config set owner "${OWNER}"

- name: Start the commit queue
run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
# Commit queue is only enabled for the default branch on the repository.
- name: Get Pull Requests and start the commit queue
run: |
prs=`gh pr list --repo ${{ github.repository }} --base ${{ env.DEFAULT_BRANCH }} --limit 100 --json number -q 'map(.number) | .[]'`
./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $prs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 16 additions & 9 deletions .github/workflows/coverage-linux.yml
Expand Up @@ -5,18 +5,25 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '**.md'
- 'benchmark/**'
- 'deps/**'
- 'doc/**'
- benchmark/**
- deps/**
- doc/**,
- AUTHORS
- .mailmap
- .github/**
- '!.github/workflows/coverage-linux.yml'
push:
branches:
- master
- main
branches: [master, main]
paths-ignore:
- '**.md'
- 'benchmark/**'
- 'deps/**'
- 'doc/**'
- benchmark/**
- deps/**
- doc/**
- 'tools/**'
- AUTHORS
- .mailmap
- .github/**
- '!.github/workflows/coverage-linux.yml'

env:
PYTHON_VERSION: 3.9
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/coverage-windows.yml
Expand Up @@ -9,16 +9,22 @@ on:
- 'deps/**'
- 'doc/**'
- 'tools/**'
- AUTHORS
- .mailmap
- .github/**
- '!.github/workflows/coverage-windows.yml'
push:
branches:
- master
- main
branches: [master, main]
paths-ignore:
- '**.md'
- 'benchmark/**'
- 'deps/**'
- 'doc/**'
- 'tools/**'
- AUTHORS
- .mailmap
- .github/**
- '!.github/workflows/coverage-windows.yml'

env:
PYTHON_VERSION: 3.9
Expand Down